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
phil.vaseyphil.vasey 

Deleting a FeedItem containing a PDF document inserts a new ContentDocumentLink

 

I can supply code if you wish, but here is my problem:

 

  1. Create some host record
  2. Create a FeedItem on that host record with a DOCX content
  3. This creates TWO ContentDocumentLink records; one linked to the host record and one linked to the User
  4. Create another FeedItem on that host record with a PDF content
  5. This creates another TWO ContentDocumentLink records
  6. Delete the host record with a trigger that deletes its FeedItems and also deletes their ContentDocuments

The DOCX ContentDocument has gone, but the PDF ContentDocument is still there.

 

The original ContentDocumentLinks for the PDF have gone, but a new ContentDocumentLink record linked to the User has been inserted (different Id).

 

Can anybody explain why this new link is inserted?

 

Furthermore, even with admin permissions, this new link cannot be APEX deleted (FIELD_INTEGRITY_EXCEPTION).