Getting ready

In this recipe, we are going to display a repeating series of a custom image 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 within Salesforce CRM as a Static Resource so we can maintain a copy and this will be referenced to enable the image to be displayed using a Salesforce formula field.

Carry out the following steps to upload an image file into Salesforce CRM as a Static Resource:

  1. Create or source a suitable image to represent a dollar symbol.
FamFamFam provides various images from its Silk Icons Library, available under the Creative Commons Attribution 2.5 License at http://www.famfamfam.com/lab/icons/silk/.
You can download the images which are contained in a ZIP file and then unzip the ZIP file to reveal the image files.
The image we have used in this recipe is a 16-by-16 pixel icon called money_dollar.png from http://www.famfamfam.comas 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 area of the main Home page.

  1. Click the Setup option, as shown in the following screenshot:
  1. Type the text 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. In the resulting Static Resources page, enter the name of the Static Resource in the Name field.
  2. Enter the text money_dollar.
  3. Click on Choose File.
  4. Select the image to upload from your computer.
In this recipe, choose the image identified in Step 1. After selecting the image file, we will be presented with the Static Resources setup screen, as shown in the following screenshot:
Ignore the Cache Control picklist selection and leave it as default Private (Cache Control is only relevant to Static Resources used in http://www.Force.com sites).
  1. Click Save.
Static Resources allow us to upload images that we can reference within Salesforce CRM, such as from formula fields, Visualforce pages, and so on. This reference is a web URL and is formed as /resource/[UNIQUE ID]/money_dollar where the UNIQUE ID is a unique ID which is generated for every Static Resource and is unique throughout every Salesforce CRM system.

Now, to find the ID for the Static Resource uploaded previously, carry out the following steps:

  1. Click on the View file link, as shown in the following screenshot:
  1. Note the Web URL that is displayed in the browser address bar; this is the ID for the Static Resource, as shown in the following screenshot:
The URL that is generated is https://widgetsxyzlex-dev-ed--c.eu11.visual.force.com/resource/1505987107000/money_dollar?isdtp=p1.
You will now need to make a note of the URL that is shown in your Salesforce instance. This URL is specified for the reference to the image in a custom formula field that is used in this recipe using the steps shown in How to do it... section.
..................Content has been hidden....................

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