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
DaibheidDaibheid 

Requiring picklists

Code:
AND ( 
NOT 
(ISPICKVAL( Stage_at_Loss__c , "")), 
( 
OR 
(ISPICKVAL( StageName, "Closed Lost"), 
 ISPICKVAL( StageName, "Abandoned")) 
 ) 
)

 
Hello all!
 
I want a picklist to be required if our Stage picklist equals "Closed Lost" or "Abandoned".  Above is the code I thought would work, and it does, but not in the way I want it to.  It will required our "Stage at Loss" picklist to be required under the given parameters, but it won't let you save the Opportunity.  You have to move it to another stage, edit the Opportunity, and then move it back.
 
Dave
 
 
rprrpr
You can do this by making your custom field dependent on the stage field, and setting the your custom field to be required on the page layout.  When you setup the field dependency matrix, only select values in your custom field for the Closed Lost and Abandoned stages.