Hi
We have considered the Account Module to validate the checkbox is checked/unchecked while saving the record in the Module.
Scenario: If Account Module having the Type = “Analyst” then Checkbox Field must be checked. If Checkbox Field is unchecked then show the Validation Message in the alert box and disallow to save the record.
Below are the screenshots. In which User Select the Type = “Analyst” and Checkbox Field is unchecked. So it shows the alert message.
Note : You can replace the Module Name in the Condition. Currently we have considered Account Module that’s why added Account Module in the Condition.
Create a js file on the below path & add code as shown in the below screenshot.
Note : In this file you just need to replace your dropdown field id with “#account_type”, Account Type Condition like Currently we have accountType = “Analyst” and checkbox field id with “#checboxfield_c”.
addToValidateCallback(
'EditView', // Form Name
'YOUR_FIELD_NAME', // field name
'bool', // Field type
false, // Is required
"ERROR MESSAGE", // Message to be displayed if not OK
function() { // Callback
// return true if the condition is OK else return false
});