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
AxxxVAxxxV 

Trigger to prevene record deletion without throwing error

I would like to prevent a user from deleting a Contact record based on certain logic based on record attributes.
However, instead of outputting an error message, I would like to update a record ownership, and not show the error to the user.

In short, can I prevent deletion without throwing an error?
TCAdminTCAdmin
Hello AxxxV,

What I would probably do is build an s-control that would be used to override the standard delete button. The s-control can have any criteria that you want in it to determine if it should delete the record or do something else.
AxxxVAxxxV
Thanks for the reply. This is exactly what I ended up doing. The trigger solution would have been better though if it were possible. It would enforce my rules on the db level, rather than at UI only when done with an S-Control...