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
Bharath SamanthulaBharath Samanthula 

lock a picklist field when checkbox is checked

Hi, I would like to know how to lock a field when a check box is checked. the field i would like to lock has picklist values. Any help?
Best Answer chosen by Bharath Samanthula
DineshKumar RK 2DineshKumar RK 2
Hi 
Bharath Samanthula

You can use the following validation rule.it will be helpfull for you.
I Think this is the solution For your Requirement .
 
  • AND( Check__c ,true) &&  ISCHANGED( Status__c )



Please mark the answer as Best Answer if it really helped.
 

All Answers

Robert ZentgrafRobert Zentgraf
Hi Bharath,

I think this can be solution:
You can use a validation rule on the picklist (IF check box=true THEN no change allowed)

Kind Regards
Robert
(mindforce: http://www.mind-force.de)
Swayam  AroraSwayam Arora
So first of all, are you talking about Standard Detail Page or Visualforce Page.
1. Visualforce Page:- You can simply use Javascript, using 'onchange' event you can disable the picklist field.
2. Standard Page:- There can be 2 ways:-
    a. Write a validation rule formula as 'checkbox_field = true && ISCHANGED(picklist_field) '. In this case, visibly the picklist field won't be locked.
    b. Create one more Record Type and one more Page layout (keeping the picklist field as read only) and assign the Page layout to the Record Type. Write a workflow which will update the record type when the check box will be checked.
    First solution is preferable.

Please mark the answer as Best Answer if it really helped.
 
DineshKumar RK 2DineshKumar RK 2
Hi 
Bharath Samanthula

You can use the following validation rule.it will be helpfull for you.
I Think this is the solution For your Requirement .
 
  • AND( Check__c ,true) &&  ISCHANGED( Status__c )



Please mark the answer as Best Answer if it really helped.
 
This was selected as the best answer