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
lewislewis 

checkbox validation

i have a checkbox field in a child object . I need a rule that checks this checkbox everytime a new child record is created. if there is one already it should not allow any other child object to be able to tick that checkbox ..

 

ex . field A is a checkbox . in object test . the parent object is train . everytime a new TEST is created in that object train, i need a rule to check if the checkbox was already ticked earlier, if yes, the user shouldnt be allowed to tick that box.

Best Answer chosen by Admin (Salesforce Developers) 
Steve :-/Steve :-/

What is the relationship between that Parent and Child object?  If it's Master-Detail you might be able to do this with a Rollup Summary Field that counts the number of Child records with Checkbox = TRUE and a VR that gives an error if the RS Count > 1

All Answers

Navatar_DbSupNavatar_DbSup

Hi,

 

you will have to write a trigger for that, you can't control this behavior through any kind of validation rule.

 

Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved. 

 

 

Steve :-/Steve :-/

What is the relationship between that Parent and Child object?  If it's Master-Detail you might be able to do this with a Rollup Summary Field that counts the number of Child records with Checkbox = TRUE and a VR that gives an error if the RS Count > 1

This was selected as the best answer
lewislewis

thanks for the help