You need to sign in to do that
Don't have an account?
John Cleveland
Validation to only allow user to change status if current status is A and only allow to change to status B
I'm usually pretty great at writing validation rules but guess this Monday isn't off to a great start. I'm trying to write one with the below criteria and I'm not getting anywhere.
Any help would be greatly appreciated!
1) All profiles except 2.
2) Certain Record Types
3) Status__c can only be changed if current status is "Status A".
4) Status__c can only be changed to "Status B".
Any help would be greatly appreciated!
1) All profiles except 2.
2) Certain Record Types
3) Status__c can only be changed if current status is "Status A".
4) Status__c can only be changed to "Status B".
AND( $Profile.Name <> 'Custom A', $Profile.Name <> 'System Administrator', CONTAINS(RecordType.Name , "Custom"), OR( NOT(ISPICKVAL(PRIORVALUE(Status__c), "Status A")), AND( ISCHANGED(Status__c), ISPICKVAL(PRIORVALUE(Status__c), "Status A"), NOT(ISPICKVAL(Status__c, "Status B")) ) ) )
Put the OR Condtion in Profiles also.
AND( OR($Profile.Name <> 'Custom A', $Profile.Name <> 'System Administrator'), CONTAINS(RecordType.Name , "Custom"), OR( NOT(ISPICKVAL(PRIORVALUE(Status__c), "Status A")), AND( ISCHANGED(Status__c), ISPICKVAL(PRIORVALUE(Status__c), "Status A"), NOT(ISPICKVAL(Status__c, "Status B")) ) ) )
Can you please Let me know if it works or not!!!
If it helps don't forget to mark this as a best answer!!!
Thanks,
Raj
July 18,
I have been hit something similar in past and I would suggest taking the following approach
1) First make a new formula field named Status_Number__c with return type NUMBER with 0 decimal place on same object and have the formula like below,
This way you can use this field (Status_Number__c) inside the validation. Why? Because it is going to give you some ability / Power to use some of the "LESS THAN" Or "GREATER THAN" functions.
2) Change your validation to something like below, Hope it helps and if it solves the query then please mark it best answer!