Home > OS >  Lock States in Salesforce
Lock States in Salesforce

Time:03-17

How can I do with a validation rule so that, for example, from the New state I only get to click Assigned. The rest of the states should give an error message or blocked (I don't know if it can be blocked)

CodePudding user response:

Read up about PRIORVALUE() function, for example https://developer.salesforce.com/forums/?id=906F00000008pFfIAI

Something like this should do the trick

ISCHANGED(Status)
&& ISPICKVAL(PRIORVALUE(Status), 'New') 
&& !ISPICKVAL(Status, 'Assigned')

This is also an interesting take: https://trailhead.salesforce.com/trailblazer-community/feed/0D54S00000A7SPhSAN

  • Related