WeDid: Custom Validation Rules on Child Records
The client would like to ensure that all the child records of a master record to be marked as “Completed” before the users can change any a specific value in the master record.
Ensure that the master and child record objects are linked using master-detail relationship.
Use a roll-up summary to calculate total child records and use roll-up summary to calculate total child records with “Completed” status.
Use validation to check if these 2 roll-up summaries match. If matched allow the changes of a value in master record if not then otherwise.
|Related Objects||Custom Object (Master) and Custom Object (Child Object)|
|Components||Data Model Design, Roll-up Summary, Validation Rules|