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
AnjaneyluAnjaneylu 

Lock the pick list field after selecting the certain value.

hi all,
I need to lock the picklist vlaue after selecting the particular field value from the picklist..
Ex: picklist Alphabets is there. and A, B , C, D, ......           all these are values..
if any user selects suppose b value,  then lock that particular field..and no body in the future has the  permission to edit that field..
it has to show like formulae field..
if other than B is selected then it has to be edited in the future....

Pleas help me from this scenario..

Thanks and regards..
Vignesh P 6Vignesh P 6
Hi anji,

You can achieve this by using Validation Rule.

=============================================
ISPICKVAL(PRIORVALUE(Picklist Name) , "Value B")
=============================================

Once the Value B is selected, We can't change to another value in picklist.


Thanks,
Vignesh P
AnjaneyluAnjaneylu
hi Vignesh..
Thanks for your reply.
i did this one,  but my requirement is no one can able have a chance to edit button for that field..

Thanks and regards
anji reddy
Vignesh P 6Vignesh P 6
Hi anji,

If your picklist is not a required field, you may follow the below way. Else Validation rule is the option.

============================
First, You need to create a separate page layout (clone of existing one) and make that picklist field as read only on the layout. Create a record type on the object and assign that page layout to the record type. 

Create a Workflow rule with the criteria, Picklist value equals "value B". Create a Field Update and the select the record type as field to update with the value of new recordtype you just created.

Now whenever the Picklist value will be changed to value B, the record type will change thereby changing the layout with the picklist field as read only.

==============================

Thanks,
Vignesh P