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
Rudix NiehausRudix Niehaus 

Delete before and after Trigger events not firing for Files

Good day.

I am trying to prevent users from deleting files they have uploaded via the Files related list on Cases. I want to add simple code in a trigger that will warn a user that he cannot delete Files linked to Cases. 

These files are stored as FeedItems that points to the ContentVersion and ContentDocument objects.
The issue that I have is that none of the triggers fires when a user deletes a File on cases. When you add a File via the related list upload button, 2 triggers fire (ContentVersion and ContentDocumentLink), but with a delete the before OR after delete events never executes.

Can anyone shed some light on this behaviour?

Thanks,
Rudolf Niehaus

new sivanew siva
Kindly let me know If you got any solution for this.