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
EdCodeEdCode 

apex trigger to delete File from Service Console (Salesforce Content)

A trigger on the following objects won't detect the deletion of a File (not Attachment but... an attached "File") when the deletion is performed by a user from Salesforce Service Console.

The triggers I have been testing with System.debug() were done on the following objects:
  • ContentDocument
  • ContentDocumentLink
  • ContentVersion
I have searched with Google a way to detect when a user is deleting a file from the Service Console (so as to consequently edit a bolean field on the parent object) but I cannot find anything.

I have found this Salesforce article which specify which object we should trigger on in order to detect the deletion bu this article does not mention the Service Console.

Based on my empirical tests, it has become obvious that Service Console does not have the same behaviour as Salesforce Classic when deleting a File from an sobject such as Case.
 
EdCodeEdCode
Here is the Salesforce article I was refering to: https://help.salesforce.com/articleView?id=000312746&language=en_US&type=1