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
Lisa SeilerLisa Seiler 

workflow formula case assign

Hi @ all,
i have a workflow and want to add a field update. This need a formula. I want to assign new values to a object and they depend on a number.
Like this:
 
CASE(IF(ISPICKVAL(Terms_of_Payment__c, '14'),1,0),
 ZTERM__c = '0017', NULL
)

If Terms_of_Payment__c(picklist) is "14" I want to assign "0017" to the field "ZTERM__c"(text) but it doesnt work. I get the error:
Error: Incorrect number of parameters for function 'CASE()'. Expected 4, received 3

I want to add more "cases" to the function, but this was the first try.

Can someone help me?
 
Best Answer chosen by Lisa Seiler
Ajay K DubediAjay K Dubedi
Hi Lisa,
I think there is no need of using ISPICKVAL function along with CASE. You can directly put the following formula and can update your field.
CASE( Terms_of_Payment__c ,'14','0017',NULL)
User-added image

User-added image

Hope it helps you.

Regards,
Ajay

All Answers

Ajay K DubediAjay K Dubedi
Hi Lisa,
I think there is no need of using ISPICKVAL function along with CASE. You can directly put the following formula and can update your field.
CASE( Terms_of_Payment__c ,'14','0017',NULL)
User-added image

User-added image

Hope it helps you.

Regards,
Ajay
This was selected as the best answer
Lisa SeilerLisa Seiler
Thank you so much, it works perfect :)))
Sometimes Im not able to not see the wood for the trees ;)