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
David Huang 34David Huang 34 

make a field conditionally required

Hi guys,

on Opportunityt object, I have a DATETIME field called "Appointment". How can I write a validation rule that only allow users to fill this field when Opportunity is at Qualification stage, if users try to fill this at another stage, like Identificaiton, validation rule will stop them, cheers

David
Best Answer chosen by David Huang 34
Salesforce TechieSalesforce Techie
(TEXT(StageName) <> 'Qualification', ISCHANGED(Appointment__c))

All Answers

Salesforce TechieSalesforce Techie
(TEXT(StageName) <> 'Qualification', ISCHANGED(Appointment__c))
This was selected as the best answer
SwethaSwetha (Salesforce Developers) 
HI David,
Try below validation rule
AND (
NOT(ISPICKVAL(StageName, "Qualification")),
NOT(ISBLANK( Appointment__c))
)
User-added image

If this information helps, please mark the answer as best. Thank you
David Huang 34David Huang 34
Thanks Amruta, it works, cheers

David