+ Start a Discussion

How do i write a Formula using a Picklist?


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.

Any suggestions from community.

Thanks in advance.

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.
Is this Resolved ?

If yes, please mark the question as Resolved.