If you want to just show the Red, Yellow, Green images based on your picklist of the Red, yellow, green text, then you can use something like this
IF(
ISPICKVAL(YourObject.YourTextRicklist__c, "Red"), IMAGE("/resource/yourRedImage.png", "red",32,32),
IF(
ISPICKVAL(YourObject.YourTextRicklist__c, "Yellow"), IMAGE("/resource/yourYellowImage.png", "yellow",32,32),
IMAGE("/resource/yourGreenImage.png", "green",32,32)
)
)
Goto setup --> Create --> Workflow & Approvals --> Workflow Rules --> New Rule
Click on New Rules Select Object
Give any name for workflow rule and select created, and any time it’s edited to subsequently meet criteria and set your criteria.
Click on save. Now set up a field update. Click on add Workflow action --> New Field Update.
Now fill the name and select which field in Field to Update dropdown
In Formula Value (Text) = Write below code
IF(ISPICKVAL(Currency , 'A'), Service* 10,
IF(ISPICKVAL(Currency , 'B') ,Service* 20,
IF(ISPICKVAL(Currency , 'C') ,Service* 40,
IF(ISPICKVAL(Currency , 'D') ,Service* 40,
0
)
)
)
)
Write this code in Workflow field update.
Another answer with Case statement
CASE(Currency ,
'A', Service* 10,
'B', Service* 20,
'C', Service* 20,
'D', Service* 40,
0
)
Best Answer
Using Workflow Field Update to set a picklist value requires a unique workflow for each possible picklist value to set.
However, you can use ProcessBuilder to set picklist fields via a formula. This was delivered in Summer 15. Here is an example where Field
some picklist
has two possible values -Choice00
andChoice01
. Using the value ofsome_currency_fld__c
, the picklist is set dynamically