You need to sign in to do that
Don't have an account?
Vinod Krishnan 33
Validation rule to prevent changing project status
Hi there,
'Projects' in our world is a created object. I'm trying to put in place a validation rule to prevent users (with the exception of a few, of course) from changing the status a project out of 'In Execution'. The below code, is an attempt to prevent the status from being changed from 'In Execution' to 'Lead'. The syntax is ok. But the code does not work. I'm seeking help to fix it. Thanks a ton!
AND(
ISCHANGED(Status__c),
(PRIORVALUE(Status__c) = "In Execution"),
(ISPICKVAL (Status__c,"Lead")),
$Profile.Name <> "System Administrator",
$Profile.Name <> "Integration Profile" ,
$Profile.Name <> "Jobscience Administrator",
$UserRole.Name <>"Contract Team"
)
'Projects' in our world is a created object. I'm trying to put in place a validation rule to prevent users (with the exception of a few, of course) from changing the status a project out of 'In Execution'. The below code, is an attempt to prevent the status from being changed from 'In Execution' to 'Lead'. The syntax is ok. But the code does not work. I'm seeking help to fix it. Thanks a ton!
AND(
ISCHANGED(Status__c),
(PRIORVALUE(Status__c) = "In Execution"),
(ISPICKVAL (Status__c,"Lead")),
$Profile.Name <> "System Administrator",
$Profile.Name <> "Integration Profile" ,
$Profile.Name <> "Jobscience Administrator",
$UserRole.Name <>"Contract Team"
)
Try like this for adding more status values:
Hope this helps!
Thanks
All Answers
Try this formula.
Hope this helps you
Let me know if this helps you. Kindly mark it as solved so that it may help others in future.
Thanks and Regards
Please try with below formula: Hope this helps! Please mark as best if it does.
Thanks
Quick follow up question - what should I add to this code for 5 more status changes? ie in addition to 'Lead', I do not want users to change an 'In Execution' project to 'Inquiry', 'Proposal', 'Lost' and 'Cancelled'. Should I just use OR functions? I tried the below but there's always a Syntax error with '(' or ')'.
AND(
ISCHANGED(Status__c),
(ISPICKVAL(PRIORVALUE(Status__c) , "In Execution")),
OR ( (ISPICKVAL (Status__c,"Lead")), (ISPICKVAL (Status__c,"Inquiry")), (ISPICKVAL (Status__c,"Proposal")), (ISPICKVAL (Status__c,"Lost")), (ISPICKVAL (Status__c,"Cancelled")), )
$Profile.Name <> "System Administrator",
$Profile.Name <> "Integration Profile" ,
$Profile.Name <> "Jobscience Administrator",
$UserRole.Name <>"Contract Team"
)
Try like this for adding more status values:
Hope this helps!
Thanks