Prevent accidental deleting of related records when deleting via script
I have a layout showing a single record from a table called "Companies". On this layout is a portal that acts as a sidebar menu, and it shows related records from a table called "Sidebar." Also on this layout is a button to delete the current record from Companies via a script; there are some verification steps in the script, but the main step is just "delete current record." I recently had an issue where I clicked the delete button, and a record from the Sidebar table was deleted instead of the Companies record. In both the Sidebar portal option dialog and on the graph, the options to delete related records are turned off. Is there something I may have overlooked to prevent this from happening again?