官术网_书友最值得收藏!

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.

主站蜘蛛池模板: 仙居县| 阳高县| 台中县| 宁陕县| 元阳县| 揭西县| 巴彦淖尔市| 双城市| 铜梁县| 枣阳市| 宜阳县| 和政县| 富蕴县| 绥棱县| 龙南县| 鹰潭市| 上思县| 当雄县| 原阳县| 丘北县| 天津市| 嘉峪关市| 鄂托克前旗| 临桂县| 铁力市| 曲沃县| 阜宁县| 宜兴市| 灌阳县| 涞水县| 高邑县| 台中县| 贡觉县| 淮安市| 搜索| 山西省| 孟州市| 宝丰县| 蚌埠市| 沧州市| 特克斯县|