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
SainSain 

How do i write a Formula using a Picklist?

Hi,

I have two objects called object1, object2(Master) and having lookup relationship among them, In object1 having a field called test1 and in Object2 having fields test2(piclist values are A,B), test3(picklist values x,y).
Now i am creating a validation rule on object1 to make test1 field mandatory while test2 is 'A' and test3 is 'x'

AND(ISPICKVAL(object1__r.test2__c='A'),ISPICKVAL(object2__r.test3__c='x') )

Getting below error:

 Field test2__c is a picklist field. Picklist fields are only supported in certain functions.

and also changed my expression with TEXT but still i am not able to sove it.
AND(TEXT(ISPICKVAL(object1__r.test2__c='A'))


Any suggestions from community.

Thanks in advance.



 
JayantJayant
The syntax is - 
ISPICKVAL(object1__r.test2__c, “A”)

Note that "A" or the String literal should be in double quotes.

If this resolves your problem, please mark it as Resolved.
JayantJayant
Is this Resolved ?

If yes, please mark the question as Resolved.