Loading

Lock a Checkbox Field after It Has Been Selected and Saved

Julkaisupäivä: Oct 13, 2022
Kuvaus
To make sure that users can’t deselect a checkbox field after it has been selected and saved, use a validation rule. 
Ratkaisu


To create a validation rule
 

1. Navigate to the validation rules section of the object that contains the checkbox you would like to lock the value.
 

In Lightning Experience

  • Setup | Object Manager | Select the object | Click on the "Validation Rules" section on the left side of the screen.


In Salesforce Classic

  • Standard Object: Setup | Search for the object name in the Quick Find box | Click on the "Validation Rules" link under the object name.
  • Custom Object: Setup | Search for Object in the Quick Find box and click it | Click on the object name | Scroll down to the "Validation Rules" section.


2. Click the New button.
3. Give the rule a name, preferably a self-descriptive one.
4. Input the following syntax for the Error Condition formula:

AND(PRIORVALUE(checkbox__c), TRUE,
ISCHANGED(checkbox__c))


Note: Replace "checkbox__c" with the API name of your checkbox field that you would lock the changes.

5. Add the Error Message and Description(optional).
6. Select Top of Page or a specific Field on 'Error Location'.
7. Click Save.

Knowledge-artikkelin numero

000385194

 
Ladataan
Salesforce Help | Article