Thursday 28 August 2014

Creating Progress Bar field using Formula| Without any coding

In this post we will discuss on creating Progress bar field without any coding, just by using formula field. Initially it seems like we can’t create dynamic progress bar field by using only formula in Salesforce. There are some approach, where developers stores 4 images with interval of 25% or 10 images with 10% interval and displaying image with help of Case or IF statement.
We will create Progress bar field, which will reflect every percentage.
Progress Bar using Formula field in Salesforce
Progress Bar using Formula field in Salesforce
To create perfect Progress bar field, we will need to take help of two images.
  1. Empty filled image with border (Download Sample)
  2. Filled rectangular image (Download Sample)
Upload above two images in Static resource. Once it is uploaded create a formula field.
In Formula field we will be appending both images and repeating “Filled Image” as per percentage field. Logic can be seen in below image.
Logic for Progress Bar using Formula field in Salesforce
Logic for Progress Bar using Formula field in Salesforce
Formula for Progress Bar Image
1IMAGE('/resource/1398170360000/BlueProgressBar''Test'10, ( percField__c * 100 )) &
2IMAGE('/resource/1398170333000/ProgressBorder''Test'10, (100 - percField__c * 100 )) &
3' ' &
4TEXT (percField__c * 100) &
5'%'

No comments:

Post a Comment