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
Michael MMichael M 

How to create new version of contentversion instead of brand new separate contentversion?

Hello, we have an integration where files (contentversions) are being inserted and the contentdocumentlink is to Lead records. My task is that sometimes a new version of the file gets inserted. When that happens, I need to create a trigger that makes it create a new VERSION of the existing document, instead of creating a brand new content version. What would such a trigger look like? 

Thank you!

VinayVinay (Salesforce Developers) 
Hi Michael,

Found below example that can help you.

https://salesforce.stackexchange.com/questions/307097/prevent-files-from-being-duplicated-contentversion-contentdocumentlink

Hope above information was helpful.

Please mark as Best Answer so that it can help others in the future.

Thanks,