Hi,
If you have no success with cascade delete (which is the usual way to do it), then you can manually delete the document history records first and then the document master - see the attached amendment to your program when you click 'delete'.
Obviously, the whole thing could be automated but I'm not sure it's a good thing to make it too easy for deletions.
If it were me, rather than physically delete a record (and lose the audit trail), I'd use a 'deleted' status (just like all your other statuses - received, printed, filed etc etc). So select a 'deleted' status and it gets automatically added to the 'document history' with a date/time stamp. You could then filter out your 'deleted' documents if you don't want your users to see them on Form1, but they'd still be held in the DB for audit purposes.
The other thing you'd need to consider are any attachments you might be holding in a 'copy to' folder (if I remember correctly, it's something you were asking about earlier). If you were physically deleting the document master and document history, it will be leaving 'orphaned' documents in your 'copy to' folder so you'd either need to manually clear those out or delete them by script.
Derek.
Post's attachments Test.zip 1.11 mb, 251 downloads since 2019-05-19