function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
vikramkkvikramkk 

Highlighting color when a picklist value is selected

Hi all

 

There is a field of type - picklist. It contains four picklist values. I want to create a horizontal bar or horizontal thick line divided in to four different colors(this can be created in separate section) i.e each picklist value correspond to one color in the bar. When one of those values is selected for that field and after the record is saved, corresponding color in the bar is highlighted.

 

How this can be achieved? How can I create a horizontal bar like that - using visual force or is there any other means?

 

(horizontal bar is what we see when coompleting a form -  bar which shows some percentage of bar in different color which is filled and other in different color which is yet to be filled)

 

hope u understand

Best Answer chosen by Admin (Salesforce Developers) 
b-Forceb-Force

If you want to show above image bar on Standard Salesforce page , means on detail page of any record.

you can achieve this by using combination of Formula fields,

This formula fields value will be based on the your pick list value, you can choose appropriate image based on picklist value,

Formula fields return type will be TEXT and you can use IMAGE tag in the formula, select appropriate image based on picklist value,

e.g.

Formula field will be like this

CASE(
TEXT( Acct_Progress__c ) ,'A',IMAGE("resource/1295064027000/Account_Progress_Bar/1","violet",15,200),
'B',IMAGE("resource/1295064027000/Account_Progress_Bar/2","violet",15,200),
'C',IMAGE("resource/1295064027000/Account_Progress_Bar/3","violet",15,200),
'NONE'
)

 

 

Let me know If you need any more help

 

Thanks ,

Bala

 

  

All Answers

b-Forceb-Force

If you want to show above image bar on Standard Salesforce page , means on detail page of any record.

you can achieve this by using combination of Formula fields,

This formula fields value will be based on the your pick list value, you can choose appropriate image based on picklist value,

Formula fields return type will be TEXT and you can use IMAGE tag in the formula, select appropriate image based on picklist value,

e.g.

Formula field will be like this

CASE(
TEXT( Acct_Progress__c ) ,'A',IMAGE("resource/1295064027000/Account_Progress_Bar/1","violet",15,200),
'B',IMAGE("resource/1295064027000/Account_Progress_Bar/2","violet",15,200),
'C',IMAGE("resource/1295064027000/Account_Progress_Bar/3","violet",15,200),
'NONE'
)

 

 

Let me know If you need any more help

 

Thanks ,

Bala

 

  

This was selected as the best answer
b-Forceb-Force

In addition add your Bar images in Static resources

 

Thanks ,

Bala

vikramkkvikramkk

Thanks for help!

 

How should I add bar images? How is  "....../Account_progress_Bar/1" or "....../Account_progress_Bar/2" work?

 

is that one bar image or a group of 3 or 4 images ? Can you please elaborate?

b-Forceb-Force

This are Bar images , which has been added into Static resources

 

Thanks,

Bala