I encourage you to avoid using User Interface for security. It can be in addition, but not in place of. You should go to permissions for that privilege set and use the boolean test to control access to the records for that table or even access to that layout.
But you can go to Inspector and to the Data tab and go down to the Hide and put the boolean in there to hide objects/fields/etc.
Use OnLayoutEnter to perform a script that either performs a find for records that are not deleted or that constrains the found set so that they are not deleted.
Set up the OnModeChange trigger to constrain the current found set to undeleted records when ever the window mode changes to Browse mode
Enter find mode [ ]
Set field [YourTable::Deleted ; 1 ]
Constrain Found Set [ ]
With this second script, any find performed by the user or by a script on this layout will automatically be constrained to omit "deleted" records.
Set up custom menus that either remove the Show All and Show Omitted options or that replace them with scripts that also omit "deleted" records.
An alternative approach to the first two scripts is to set up record access control in manage security to keep non full access users from viewing "deleted" records. "no access" records are automatically omitted from scripts performed by the user both manually and via a script so that would leave only the need for a custom menu to complete this process.
Thank you, this is exactly what I was trying to do!
Thank you Taylor. It's not really for security purposes. It's mostly because users want to delete records if they accidentally duplicate an Account and use a slightly different Account Name.
No reason for them not to see these records or have access to them besides just having them not show up in their searches. If they ever want to pull these records up intentionally or if they accidentally "delete" the wrong account it can be restored easily.
Another option I'm thinking about is having a server-side script that exports the accounts marked for delete into an archive folder on the server then removes the account and related records from the live system. This way I can restore from an archive if a user accidentally removes the wrong account.