0

I have a requirement where when I attach or delete a file in attachments of a Case I have some fields to updated accordingly. I have noticed that when I insert an attachment, the Content Version trigger gets called. Where as when I am deleting an attachment, the Content Document trigger is called, not Content Version trigger nor Attachment trigger. Is it because the Content Document has only one Content Version?

When I insert the same file again as attachment, I am creating a new Content Version with new Content Document. How can I create a new Content Version for the same Content Document? Is by apex (querying for a Contend Document and adding a Content Version) the only way I can create new Content Versions to the same Content Document?

1 Answer 1

1

Found the answers.

Is it because the Content Document has only one Content Version?

  • We cannot delete a content version but only the content document. The number of Content Versions does not matter.

How can I create a new Content Version for the same Content Document? Is by apex (querying for a Contend Document and adding a Content Version) the only way I can create new Content Versions to the same Content Document?

  • Using the UI I can upload a new version of the document and not just using Apex.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .