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
waylonatcimwaylonatcim 

Triggers on ContentDocument

Is there any way to put a trigger on a ContentDocument?  I would like to have an action fire after one is deleted from the system, but it looks like I can only create a trigger on ContentVersion.

 

Any thoughts?

MarlonMarlon

Hi,

 

I created a "delete" trigger for the ContentDocument and it does get fired when one deletes a Document from the Salesforce standard page. However it doesn't seem to get called when executing a 'delete' DML operation from an Apex code.

 

Any ideas?

 

Thanks

Andrea mAndrea m

hi Marlon,

did you get any reply on this issue. We are facing the same situation on our test method code .

 

thanks

 

MarlonMarlon

Hi Andrea, 

 

Unfortunately I didn't, so we changed our approach (i.e. without the trigger).

 

Cheers

CrazyDevCrazyDev

Can you please let me know the approach you have taken for having the validation rule?