You need to sign in to do that
Don't have an account?
Michael Villegas
Validation Rule - Restrict value change for select values
Hello!
Attempting a script that allows the user to pick values freely with the exception of 3 values. If the users selects any of the 3 defined values, restrict the user from make any further revisions to the picklist.
Below is my current attempt, this works to keep the user from selecting the 3 defined values per their user role, however I'm trying to allow them to select the value but then "lock" the value once it has been selected. Does this scenerio sound feasible via validation rule?
AND((CONTAINS($UserRole.Name,'Contractor')),
OR(ISPICKVAL(eo2__Project_Status__c, 'Work Complete')
,ISPICKVAL(eo2__Project_Status__c, 'Batched')
,ISPICKVAL(eo2__Project_Status__c, 'Incentive Authorized')
))
Any help would be appreciated!
Thanks!
Michael
Attempting a script that allows the user to pick values freely with the exception of 3 values. If the users selects any of the 3 defined values, restrict the user from make any further revisions to the picklist.
Below is my current attempt, this works to keep the user from selecting the 3 defined values per their user role, however I'm trying to allow them to select the value but then "lock" the value once it has been selected. Does this scenerio sound feasible via validation rule?
AND((CONTAINS($UserRole.Name,'Contractor')),
OR(ISPICKVAL(eo2__Project_Status__c, 'Work Complete')
,ISPICKVAL(eo2__Project_Status__c, 'Batched')
,ISPICKVAL(eo2__Project_Status__c, 'Incentive Authorized')
))
Any help would be appreciated!
Thanks!
Michael
<pre>
AND
( CONTAINS( $UserRole.Name, 'Contractor' )
, ISCHANGED( eo2__Project_Status__c )
, OR
( ISPICKVAL( PRIORVALUE( eo2__Project_Status__c ), 'Work Complete' )
, ISPICKVAL( PRIORVALUE( eo2__Project_Status__c ), 'Batched' )
, ISPICKVAL( PRIORVALUE( eo2__Project_Status__c ), 'Incentive Authorized' )
)
)
</pre>
All Answers
With Validation rule, you can not able to lock the record.
You can use Approval process lock action on Status Change to lock the record and use filed history to track the changes.
<pre>
AND
( CONTAINS( $UserRole.Name, 'Contractor' )
, ISCHANGED( eo2__Project_Status__c )
, OR
( ISPICKVAL( PRIORVALUE( eo2__Project_Status__c ), 'Work Complete' )
, ISPICKVAL( PRIORVALUE( eo2__Project_Status__c ), 'Batched' )
, ISPICKVAL( PRIORVALUE( eo2__Project_Status__c ), 'Incentive Authorized' )
)
)
</pre>