1

I need a validation rule that prevent user to edit the record when the status is "under approval", however the status can be edit to other values. I tried the formula above, but the syntax is wrong. I'm pretty new on validations and I don't understand this very well. :( Someone can help me on this?

AND( ISPICKVAL(  Status__c  , "Under Approval") , 
     NOT( ISPICKVAL( PRIORVALUE(Status__c) , "Approved"), 
          ISPICKVAL( PRIORVALUE(Status__c) , "Paid"),
          ISPICKVAL( PRIORVALUE(Status__c) , "Rejected"), 
          ISPICKVAL( PRIORVALUE(Status__c) , "Unpaid")
         )
2
  • if you are trying to lock down edits to all fields except one on the record when it is status=approved, one good technique is to change the record type of the object to Approved and then create a different page layout that has all the fields except status as read only
    – cropredy
    Nov 13 '15 at 20:36
  • Do you have an approval process on this object?
    – Samir
    Feb 23 '17 at 7:30
1

The issue isn't with your validation rule, it's your approval process. The record needs to be "locked" when it enters the approval process and "unlocked" once it's approved. Only the person who's approving the record will be able to edit it to change the status to approved.

0

There is a missing ) at the end of the validation rule.

AND( 

    ISPICKVAL( Status__c , "Under Approval") , 
    NOT(
      OR(
      ISPICKVAL( PRIORVALUE(Status__c) , "Approved"), 
      ISPICKVAL( PRIORVALUE(Status__c) , "Paid"), 
      ISPICKVAL( PRIORVALUE(Status__c) , "Rejected"), 
      ISPICKVAL( PRIORVALUE(Status__c) , "Unpaid")
      )
    )

 ) // add this to your rule

Added an OR inside the NOT - but i dont know exactly what your requirement is

5
  • this formula is not working. :( Nov 13 '15 at 17:54
  • Changed my answer - added an OR. But i don't know your exact requirement.
    – kausDix75
    Nov 13 '15 at 18:07
  • I need a validation rule to prevent the user to update a record when the status is equal to "approved", the only field that the user can edit when the status is equal to "approved" is the status field itself. Nov 13 '15 at 18:13
  • This is different than the one in your original post.
    – kausDix75
    Nov 13 '15 at 18:47
  • I'm sorry, isn't "approved" but "under approval". Nov 16 '15 at 11:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.