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
Vinnie BrezinskyVinnie Brezinsky 

Making a field mandatory for certain opportunity stages

I am trying to build a Validation Rule that if our opportunity stage is Closed Won, Closed Lost, No Decision, that the custom resolution feilds we created for resolution need to be filled out. I read some old forms and I was told to use a formula like this, but it does not seem to be working. Is there something I am doing wrong?
Thanks in advance

AND ( 
TEXT(StageName) = "Closed Won,Closed Lost,No Decision", 
ISBLANK( Resolution_Date__c ))
Best Answer chosen by Vinnie Brezinsky
Vinoth Vijaya BaskerVinoth Vijaya Basker
Hi Vinnie, 

Please try the below validation formula, 

AND (
  OR (
     ISPICKVAL(StageName, "Closed Won"),
     ISPICKVAL(StageName, "Closed Lost"),
     ISPICKVAL(StageName, "No Decision")),   
     ISBLANK( Resolution_Date__c )
)

Thanks,
Vinoth

All Answers

Vinoth Vijaya BaskerVinoth Vijaya Basker
Hi Vinnie, 

Please try the below validation formula, 

AND (
  OR (
     ISPICKVAL(StageName, "Closed Won"),
     ISPICKVAL(StageName, "Closed Lost"),
     ISPICKVAL(StageName, "No Decision")),   
     ISBLANK( Resolution_Date__c )
)

Thanks,
Vinoth
This was selected as the best answer
Vinnie BrezinskyVinnie Brezinsky
Thanks Vinoth. One more quick help if you could. One of the fields in our resolution section is a picklist field. When I try to use this field in the formula, I get the follow error. Error: Field Resolution_Type__c is a picklist field. Picklist fields are only supported in certain functions. Tell me more. Is there a way to get this to work?
Vinoth Vijaya BaskerVinoth Vijaya Basker
Can you please post the formula where you get the error? 


Thanks,
Vinoth
Vinnie BrezinskyVinnie Brezinsky
Sure.I am guessing the ISBLANK is not the correct formula to use since a picklist is technically never blank. Which formula would I use than?

AND (
  OR (
     ISPICKVAL(StageName, "Closed Won"),
     ISPICKVAL(StageName, "Closed Lost"),
     ISPICKVAL(StageName, "No Decision")),   
     ISBLANK(  Resolution_Type__c  )
)
Vinoth Vijaya BaskerVinoth Vijaya Basker
Please try the below formula if Resolution_Type__c is a picklist field, 


AND (
  OR (
     ISPICKVAL(StageName, "Closed Won"),
     ISPICKVAL(StageName, "Closed Lost"),
     ISPICKVAL(StageName, "No Decision")),   
     ISBLANK(  TEXT(Resolution_Type__c)  )
)

Thanks,
Vinoth
Vinnie BrezinskyVinnie Brezinsky
That worked, thanks for all your help.