Requirement is
User should be able to edit if
Status = New
OR
Status = Pending Approval AND Prior Status = New
OR
Status = Approved AND PRIOR Status = Pending Approval.
OR
Status = Rejected AND PRIOR Status = Pending Approval.
Here is the Validation Rule I created which is not working as it should be
AND(
$Profile.Name <> 'Billing',
$Profile.Name <> 'System Administrator',
$Profile.Name <> 'Finance Users',
OR(
RecordType.Name = 'PO Request (B)',
RecordType.Name = 'Invoice'
),
NOT(
OR
(
TEXT(Status__c) = 'New',
AND(
TEXT(Status__c) = 'New',
TEXT(Status__c) = 'Pending Budget Line Owner Review'),
AND(
TEXT(PRIORVALUE(Status__c)) = 'New',
TEXT(Status__c) = 'Pending Budget Line Owner Review'),
AND(
TEXT(PRIORVALUE(Status__c)) = 'Pending Budget Line Owner Review',
TEXT(Status__c) = 'Budget Line Owner Approved'),
AND(
TEXT(PRIORVALUE(Status__c)) = 'Pending Budget Line Owner Review',
TEXT(Status__c)='Budget Line Owner Rejected'),
AND(
TEXT(PRIORVALUE(Status__c)) = 'Budget Line Owner Rejected',
TEXT(Status__c)='Pending Budget Line Owner Review')
)
)
)
2 Antworten