There is a master-detail relationship between two objects and I want to ensure that the master object should not have more than 10 child records. How can we achieve this without using a trigger ?
How to achieve a validation on Master for child's count in Master-Detail relationship without Apex Trigger?
Create Roll-up summary - COUNT field on Parent object and validation rule
If you’re trying to enforce a record limit of 25 on the parent roll-up summary field, create validation rules on your child objects. When you add a child record, your validation rule on the child object can check if the count is already 25 or greater.
from documentation - Best Practices
will this solution be always real-time? As mentioned here "Calculating roll-up summary field values can take up to 30 minutes, depending on the number of records affected and other factors". May 29, 2022 at 12:36
I believe that is about sharing recalculation and owners, currency recalculation, .etc .– Pavlo MMay 30, 2022 at 7:34