Is there any way we can delete Latest Version from ContentDocument?
I have tried deleting ContentVersion, but DML Operation Delete is not allowed on it.
I have tried deleting ContentDocument, but it deletes ALL versions and the document itself.
Is there any way we can delete Latest Version from ContentDocument? I have tried deleting ContentVersion, but DML Operation Delete is not allowed on it. I have tried deleting ContentDocument, but it deletes ALL versions and the document itself. |
|||
|
Yes, all the version will be deleted, check the doc here, ContentDocument 'When you delete a document, all versions of that document are deleted, including ratings, comments, and tags.' Yeah, there is no standard way to do this. But you can copy the latest version to a new file, and delete all the old version, like this,
|
|||||
|