Presenting Account Credit Score using Google Image Chart : In our previous Salesforce Tutorial we have learned about Creating an Account Revenue indicator using formula field. In this Salesforce Training Tutorial we are going to learn about presenting Account Credit Score using Google Image Chart.
Presenting Account Credit Score using Google Image Chart means rendering a credit score graphically using Google chart using Google-O-Meter chart. In this process we use salesforce crm formula fields. Google-O- meter chart is a dial-type which is developed by Google.
For presenting Account Credit Score follow the steps shown below
Go to Setup=>Customize=>Accounts=>Fields.
Select New Button.
Choose number from the data type.
Select next button.
- Enter Field label as Credit Score.
- Length as 18.
- Decimals places as 0.
- Click on next button.
Now we have to establish field level security and assign page layouts to which this field is to appear.
Finally select save button.
Now go to Setup=>Customize=>Accounts=>Fields.
Select Formula field as data type and select next button.
- Enter field label as Credit score graphic.
- Field name will be automatically generated with underscores.
- Select Text as formula return type.
- Click on next button.
For presenting Account Credit Score we have to write some code. Use the code shown below.
[codesyntax lang=”sql” lines_start=”0″ title=”Google chart type Google 0 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" )
[/codesyntax]
Treat blank fields as blanks in blank field handling section.
Now select next and establish field level security and assign page layouts to which this field is to appear.
Select Save button.
Successfully we have created salesforce crm custom field for presenting Account Credit Score using Google Image Chart. To test the working of this application go to any of the account in salesforce.com and open it in detail view and we will observe the meter.
Observe from above image we have given credit score as 75 and it is shown in graphical form from Google image chart.