+ Start a Discussion

Check Box Validation

Is there a way to validate my check box field , in order to keep only one of all objectes should have the field ticked?


Only trigger can do it.


Can you explain a bit more? What are you trying to do?


Hey, create a unique text field and using Workflow field update, put the value as "Checked" when criteria (Checkbox__c && ISCHANGED(Checkbox__c)) is passed. Since unique fields will not allow duplicate values, you cannot check the checkbox again in other records.


Let me know if it helps.


Thanks for you reply.


I did it using a trigger. but i was looking for a easier way


I have a checkbox (active) in a custom object. 

if there is at least 1 record in the database with active ticked, I want to stop saving records with active ticked


After creating unique field, WFR rule just change that record's value to unchecked and save, then select it and save. Now on, you will not be allowed to create/update other records with checkbox selected. Yes, I agree you can do it with triggers. But you will have other issues like test classes,code coverage, moving to production etc. I am a big fan of trigger.

Richa KRicha K


I am not sure... but if you can use jquery and retrive the checkbox value whether ticked or not.........and do ur actions.........