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
MSVRadMSVRad 

Picklist Validation Rule Help

I am trying to write a validation rule for two picklists.

 

If one picklist (StageName) is on option "Closed Lost" then the second picklist "Lost Reason" cannot be "null" or a value must be selected.

 

I tried this:

 

AND (
ISPICKVAL( StageName , "Closed Lost"),
ISNULL( Lost_Reason__c )
)

 

Then I get an error saying that the ISNULL function cannot be used on a picklist.

 

Is there a function that I can use for this purpose or do I need to write an apex trigger?

Best Answer chosen by Admin (Salesforce Developers) 
mpannmpann

Try this:

 

AND (
ISPICKVAL( StageName , "Closed Lost"),
ISPICKVAL ( Lost_Reason__c, "" )
)

All Answers

mpannmpann

Try this:

 

AND (
ISPICKVAL( StageName , "Closed Lost"),
ISPICKVAL ( Lost_Reason__c, "" )
)

This was selected as the best answer
MSVRadMSVRad
Thank you for your response. It worked like a Charm!