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

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.

主站蜘蛛池模板: 察雅县| 南阳市| 盐津县| 博兴县| 怀柔区| 永泰县| 虞城县| 商丘市| 南汇区| 永济市| 双牌县| 腾冲县| 友谊县| 南皮县| 玉环县| 溧阳市| 丽江市| 洱源县| 崇仁县| 九龙城区| 体育| 海伦市| 个旧市| 兴化市| 子洲县| 桂东县| 青龙| 贵港市| 齐齐哈尔市| 武乡县| 梧州市| 隆德县| 靖西县| 久治县| 泰来县| 胶南市| 常德市| 康乐县| 嘉峪关市| 麦盖提县| 沈阳市|