function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
SFmaverickSFmaverick 

Lock picklist after a specific value is selected

I have the same problem. I want to lock the picklist field from being edited after the picklist value "Completed" is selected.

 

Picklist = Drugscreen

"Need To Submit"

"Submitted"

"Completed"

 

After "Completed" is selected I want to lock the picklist from being edited. 

 

Best Answer chosen by Admin (Salesforce Developers) 
Steve :-/Steve :-/

You're welcome, you owe me a beer...

http://beeradvocate.com/beer/profile/863/7971/ 

 

 

Oh yeah, if you want to exempt Admins or any other Profiles from the VR just amend the VR Formula like this

 

AND(ISCHANGED(Picklist_1__c ),

ISPICKVAL(PRIORVALUE(Picklist_1__c ), "A"),

NOT(ISPICKVAL( Picklist_1__c , "A")),

NOT($Profile.Name = "System Administrator"))

 

 

 

Message Edited by Stevemo on 03-29-2010 04:55 PM

All Answers

Steve :-/Steve :-/

 Here's one I did that might work for you

 

 

AND(
ISCHANGED(Picklist_1__c ),
ISPICKVAL(PRIORVALUE(Picklist_1__c ), "A"),
NOT(ISPICKVAL( Picklist_1__c , "A"))
)

 

Message Edited by Stevemo on 03-26-2010 05:28 PM
EnthEnth

If you want to disable the control instead of validating for changes you can also create a workflow that changes the record type for the object to one that is associated to a different page layout, with the field marked Read Only.

 

Stevemo's solution is better if you want to stop Admins changing it too 

SFmaverickSFmaverick

Thanks,

 

It Worked.

Steve :-/Steve :-/

You're welcome, you owe me a beer...

http://beeradvocate.com/beer/profile/863/7971/ 

 

 

Oh yeah, if you want to exempt Admins or any other Profiles from the VR just amend the VR Formula like this

 

AND(ISCHANGED(Picklist_1__c ),

ISPICKVAL(PRIORVALUE(Picklist_1__c ), "A"),

NOT(ISPICKVAL( Picklist_1__c , "A")),

NOT($Profile.Name = "System Administrator"))

 

 

 

Message Edited by Stevemo on 03-29-2010 04:55 PM
This was selected as the best answer