Saturday 12 May 2012

SP.File.MoveTo() Error "MoveOperations is undefined" SharePoint


SP.File.MoveTo()  so I heard some complains about not being able to move files from one document library to other using Javascript Client Object model in SharePoint. One of my collegues was using

SP.File.MoveTo(destinationLib, MoveOperations.Overwrite);

well I guess he missed the fun part of this command. The correct syntax is

SP.File.MoveTo(destinationLib, 1);

Here are the options that you can use -

Member name             Description
None                            The value = 0.
Overwrite a file            The value = 1.      
AllowBrokenThickets  The value = 8.   


Check out MoveOperations Enumeration on MSDN for more.
Enjoy!



Ads by Google

No comments:

Post a Comment