Getting ready

In this recipe, we are going to display a company logo on the Home page and we can either use an image file that we have created ourselves or use one obtained from an external source.

We will store the image file in the Salesforce CRM application as a resource so we can maintain a copy, and this will then be linked to enable the image to be referenced in our Lightning component.

Carry out the following steps to upload an image file into Salesforce CRM using Static Resources:

  1. Create or source a suitable image to be used as a company logo in the JPG, GIF, or PNG format and approximately 200 x 40 pixels, as shown in the following screenshot:
  1. Click on the Setup gear icon, as shown in the following screenshot:
The Setup gear icon is located in the top right-hand corner of the main Home page.
  1. Click the Setup option, as shown in the following screenshot:
  1. Type static resources in the Quick Find search box, as shown in the following screenshot:
  1. Select the Static Resources option.
  2. Click on New, as shown in the following screenshot:
  1. Click on New.
  2. Enter the name of the Static Resource in the Name field. For this recipe, type WidgetsXYZlogo.
  3. Enter This is the company logo for WidgetsXYZ in the Description field.
  4. In the file uploader control, click on the Browse... button to select the image to upload from your computer. In this recipe, choose the image identified in step 1.
  5. Ignore the Cache Control picklist selection and leave it as default Private (Cache Control is only relevant to static resources used in https://www.force.com/, a Salesforce technology used for creating public web applications and web sites).
  6. The Static Resources setup screen appears as shown in the following screenshot:
  1. Click on Save.
  2. In the resulting Static Resource Detail page, click on View file, as shown in the following screenshot:
  1. In the resulting Static Resource Detail page, you can verify that the image is loaded by clicking on View file, which will load the file that has been uploaded. In our example, this is our company logo:
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset