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
HariniHarini 

How to restrict the user to add or delete records to a child object

I read in some of the sfdc study guides with eamples to recruiting application,  if a position is closed the reviewer should not be able to add or delete a review and this could be done using roll up summary fields.Could anybody please explain how can that be accomplished.
 

In my case I want to restrict the user from adding or deleting the child records only when the master records status is closed. If the status of the master record is something else other than closed the user can add child records once the status changes he should be restricted.

 
aalbertaalbert

You could use a validation rule to prevent the insert operation. But not sure you could use a validation rule to support the delete.

 

Otherwise, an apex trigger on the child object would work. And before you insert or delete, check that logic.