
Based on the value chosen in a picklist, calculate a result in a separate field. For example, if value "A" is chosen in the picklist, then calculate the "Amount" field * 90%. If value "B" is chosen in the picklist, then calculate :Amount" field *60%
Any help is apprciated.
2 respostas
You can simply create a Formula Field for this =
- Label: Discounted Amount
- Type: Formula
- Return Type: Number
- Formula:
Amount - ( CASE( Picklist_Field__c, "A", 0.9, /* 90% */ "B", 0.6, /* 60% */ "C", 0.3, /* 30% */ NULL ) * Amount)
In here we are calculating the Discounted Amount. For example if the Amount was 1000 USD and the Picklist Value is 30% then the calculation is -1000 - (1000 * 0.3) = 1000 - 300 = 700
In case if you just want to show the Discount Amount solely then this =
CASE(
Picklist_Field__c,
"A", 0.9, /* 90% */
"B", 0.6, /* 60% */
"C", 0.3, /* 30% */
NULL
) * Amount
This will yield: 300 USD