I am trying to write a validation rule to prevent the stages of an opportunity from being changed if certain cycle time fields are blank. For example if date of request and date of approval are blank; stage can not move from prospecting
Yes. validation rule will be able to achieve this. Something like AND(ISBLANK(APPROVAL DATE)), AND(REQUEST DATE), ISPICKVAL(PRIORVALUE(StageName), "Prospecting"), ISCHANGED(StageName))
Kindly check for syntax error and api name picklist values for your org.
I am getting syntax errors. extra "," before the 2nd AND; when removed then extra "AND" on second "and" everytime I remove what is referred to as "extra" I get another syntax error
No syntax errors, but tested validation rule and it does not populate error. I mistated the need though. The dates being blank are OR instead of AND. I changed the operator to "OR" in the beginning of code but it makes the error generate when the stage is changed regardless if date fields are populated.
AND(OR(ISBLANK( date_of_Request__c ), IsBlank( Date_Of_Approval__c )), ISPICKVAL(PRIORVALUE(StageName),"Prospecting"), ISCHANGED( StageName ) )
I think it should work. Let me know for any issues.
Thanks
Arpit
All Answers
AND(ISBLANK(APPROVAL DATE)), AND(REQUEST DATE), ISPICKVAL(PRIORVALUE(StageName), "Prospecting"), ISCHANGED(StageName))
Kindly check for syntax error and api name picklist values for your org.
Try below validation rule (Updatefield api name based on your date fields)
AND(ISBLANK( date_of_Request__c ), IsBlank( Date_Of_Approval__c ), ISPICKVAL(PRIORVALUE(StageName),"Prospecting"), ISCHANGED( StageName ) )
Let me know for any further concerns with this.
Mark this as solved if it helps.
Thanks
Arpit
AND(OR(ISBLANK( date_of_Request__c ), IsBlank( Date_Of_Approval__c )), ISPICKVAL(PRIORVALUE(StageName),"Prospecting"), ISCHANGED( StageName ) )
I think it should work. Let me know for any issues.
Thanks
Arpit
ISBLANK(TEXT(StageName ))
Mark this as solved if it helps.
Thanks
Arpit
ISBLANK(TEXT( Ultimate_Risk_Approver__c)),