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
    Commented Nov 13, 2015 at 20:36
  • Do you have an approval process on this object?
    – Samir
    Commented Feb 23, 2017 at 7:30

2 Answers 2

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. :( Commented Nov 13, 2015 at 17:54
  • Changed my answer - added an OR. But i don't know your exact requirement.
    – kausDix75
    Commented Nov 13, 2015 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. Commented Nov 13, 2015 at 18:13
  • This is different than the one in your original post.
    – kausDix75
    Commented Nov 13, 2015 at 18:47
  • I'm sorry, isn't "approved" but "under approval". Commented Nov 16, 2015 at 11:35

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .