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
PREM KUMAR 275PREM KUMAR 275 

Restrict the User other than system admin and Support Admin who tries to delete an Account record when there is a related child record of Opportuniy and Contact.

Using Triggers
Restrict the User other than system admin and Support Admin who tries to delete an Account record  when there is a related child record of Opportuniy and Contact.
ShirishaShirisha (Salesforce Developers) 
Hi Prem,

Greetings!

You can achieve this by creating an Apex trigger along with the Custom Label which can has the Users which you would like to restrict.

Please find the sample code in the below thread and make changes according to your requirement.

https://developer.salesforce.com/forums/?id=9060G0000005X0UQAU

Kindly mark it as best answer if it helps so that it can help others in the future.

Warm Regards,
Shirisha Pathuri