Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I'm using the Client Object Model to interface my application to SharePoint 2010 Foundation.

This application generates some versions of the same file... it's possible to see all the versions in the file version history...

The problem is that I have to delete the old versions of the file, not necessarily all of the versions...

Is it possible to do this? How can I do this?

Thanks to all.

share|improve this question

1 Answer 1

You could try something like this:

var fileName = '/myfile.txt';
var ctx = new SP.ClientContext();
ctx.get_web().getFileByServerRelativeUrl(fileName).get_versions().deleteAll();
c.executeQueryAsync();​
share|improve this answer
    
thanks i use this ide to create my base method. –  Stefano Ricci Sep 25 '12 at 14:48
    
Glad I could help :) Feel free to consider accepting the answer if you think it gave you the appropriate amount of assistance. –  eirikb Sep 25 '12 at 14:51

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.