cancel
Showing results for 
Search instead for 
Did you mean: 

How to delete 'old versions' of content-document.

amit_wmw
Champ in-the-making
Champ in-the-making
Hello

Is there any way to delete "old versions" of content-document (via API) while just leaving the current version? If you have any related sample, please share or any suggestions regarding the same also will be much appreciable

Thanks
Amit.
2 REPLIES 2

t_broyer
Champ in-the-making
Champ in-the-making
The simplest way is to remove the versionnable aspect (and re-add it later).

Otherwise, the VersionService has a deleteVersionHistory method that does just that.

amit_wmw
Champ in-the-making
Champ in-the-making
Thanks dear!

After 33 views someone replied and replied correctly  Smiley Very Happy Thanks it worked well.

regards-
Amit