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
Menaka RaghuvanshiMenaka Raghuvanshi 

Formula which takes into consideration Record type and field type

Hi,

I want to build a formula which should have the following logic. Not sure how to go about it. Can I have some suggestions please

Value in a certain field should be "Text" IF Record type is let's say "XYZ" and a PICKLIST field has a value "123" then
Value in the field should be "Text 1" if the record type is "abc" and Picklist field has the value "456"
David ZhuDavid Zhu
IF( testfield__c = 'xyz' && ISPICKVAL( picklist__c , '123') , 'text', 
IF( textfield__c = 'abc' && ISPICKVAL( picklist__c , '456') , 'text1', '') )
Menaka RaghuvanshiMenaka Raghuvanshi
Thanks David,

I tired it and it looks something like below. However, I get an error " Error: Incorrect number of parameters for function 'IF()'. Expected 3, received 4". Do you know why I am getting the error. I get this error when I use more than one IF condition. Works fine when I use the IF condition only once

IF(RecordType.DeveloperName = "ConsultingServices" && ISPICKVAL( Service_Category__c , "PS Brazil"),"JB Bassett", "Sidhir Dubey",
IF(RecordType.DeveloperName = "ConsultingServices" && ISPICKVAL( Service_Category__c , "PS LATAM"),"Jenette Garcia", "Sudhir Dubey",
IF(RecordType.DeveloperName = "ConsultingServices" && ISPICKVAL( Service_Category__c , "PS India"), "Narayan Murthy", "Sudhir Dubey")))

 
David ZhuDavid Zhu
IF(RecordType.DeveloperName = "ConsultingServices" && ISPICKVAL( Service_Category__c , "PS Brazil"),"JB Bassett",
IF(RecordType.DeveloperName = "ConsultingServices" && ISPICKVAL( Service_Category__c , "PS LATAM"),"Jenette Garcia", 
IF(RecordType.DeveloperName = "ConsultingServices" && ISPICKVAL( Service_Category__c , "PS India"), "Narayan Murthy", "Sudhir Dubey")))