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.

Presenting Account Credit Score using Google Image Chart

Select New Button.

Presenting Account Credit Score using Google Image Chart

 Choose number from the data type.

Presenting Account Credit Score using Google Image Chart

Select next button.

Presenting Account Credit Score using Google Image Chart

  • 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.

Presenting Account Credit Score using Google Image Chart

Select Formula field as data type and select next button.

Presenting Account Credit Score using Google Image Chart

  • 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.
Presenting Account Credit Score using Google Image Chart

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.

Presenting Account Credit Score using Google Image Chart

Now select next and establish field level security and assign page layouts to which this field is to appear.

Presenting Account Credit Score using Google Image Chart

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.

Presenting Account Credit Score using Google Image Chart

Observe from above image we have given credit score as 75 and it is shown in graphical form from Google image chart.