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
LibraLibra 

Force a Picklist Entry

I am tring to force a user to pick a picklist item in a Picklist field called Lost Reasons if the Opportunity Stage is Closed Lost.  I am using the following formula:
AND (  
     ISPICKVAL( StageName, "Closed Lost"),
     ISNULL(Lost_Reasons )
)
 
However, I get a syntax error message saying "Error: Field Lost_Reasons__c is a picklist field. Use it with an ISPICKVAL() or CASE() function instead."
What would be the proper way to do this?
Also, where is the best place to go to get information on conditional 
error formulas?
 
Donovan KrugerDonovan Kruger
I'm assuming this is for a Validation Rule?

I've noticed that ISNULL doesn't always work.  Don't know exactly why, but I've been avoiding using it.

Instead, try:

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

greggatssdgreggatssd
ISNULL is not meant to work with text fields from what I have read. Im assuming thats a text field...

LibraLibra
Yes, this is a validation rule.  Thanks for the tip I will try it.
LibraLibra
That worked.  Thanks for your help.