![Salesforce CRM Admin Cookbook(Second Edition)](https://wfqqreader-1252317822.image.myqcloud.com/cover/376/36700376/b_36700376.jpg)
上QQ阅读APP看书,第一时间看更新
How to do it...
Carry out the following steps to create an account Credit Score formula field that uses the data contained in a custom field to display a Google Chart graphic:
- Click on the Setup gear icon in the top right-hand of the main Home page, as shown in the following screenshot:
![](https://epubservercos.yuewen.com/F5F0D9/19470399608916606/epubprivate/OEBPS/Images/Chapter_229.jpg?sign=1738955471-rrk0aYDUgnhTzK8bCHdr8e5ZZVaTgt6I-0-03a9b92484241203bdb548e280a5a8c0)
- Click the Setup option, as shown in the following screenshot:
![](https://epubservercos.yuewen.com/F5F0D9/19470399608916606/epubprivate/OEBPS/Images/Chapter_272.jpg?sign=1738955471-rUOVJvDpHJZpew1jV7C9ROR4nyInZZAm-0-debaede17da6a6ca8258233d5d7b51ee)
- Navigate to the Account customization setup page, by clicking the following: Objects and Fields | Object Manager | Account | Fields and Relationships.
- Locate the Fields & Relationships section on the right of the page.
- Click New.
We are presented with the Step 1. Choose the field type page.
- Select the Formula option.
- Click Next.
We are presented with the Step 2. Choose output type page.
- Type Credit Score Graphic in the Field Label textbox.
- Click on the Field Name. When clicking out of the Field Label textbox, the Field Name is automatically filled with the value Credit_Score_Graphic.
- Set the Formula Return Type as Text.
- Click Next.
We are presented with the Step 3. Enter formula page.
- Paste the following code in the formula edit box (as shown in the next screenshot):
/*********************************************************** Google Chart type Google-O-meter ***********************************************************/ IF( ISNUMBER( TEXT(Credit_Score__c) ), IMAGE( "http://chart.apis.google.com/chart?cht=gm" & "&chxl=0:|0|50|100&chxt=y&chs=200x120&chls=2|10" & "&chd=t:" & TEXT((Credit_Score__c)) & "&chl=" & TEXT(Credit_Score__c), "Credit Score Graphic" ), "Not Specified" )
- In the Blank Field Handling section, select the option Treat blank fields as blanks, as shown in the following screenshot:
![](https://epubservercos.yuewen.com/F5F0D9/19470399608916606/epubprivate/OEBPS/Images/Chapter_146.jpg?sign=1738955471-NSDcLU0lGH2Zsf5oMC6m4G5ux9KUklpK-0-bfa10c986e2762a72827d96c33abf34b)
- Optionally, enter a value in the Description field.
- Optionally, enter a value in the Help Text field.
- Click Next.
We will be presented with the Step 4. Establish field-level security page.
- Select the profiles to which you want to grant edit access to this field via the field-level security. The field will be hidden from all profiles if you do not add it to the field-level security.
- Click Next.
We will be presented with the Step 5. Add to page layouts page.
- Select the page layouts that should include this field. The field will be added as the last field in the first two-column section of these page layouts. The field will not appear on any pages if you do not select a layout.
- Finally, click Save.