i am currently running some code on a sharepoint front end and am getting this error
"Microsoft.SharePoint.SPException"
"Cannot complete this action.\n\nPlease try again."
So i looked into this and it seems its because i dont have the right permissions on the list. But when i check the permissions i have Full control.
What am trying to achieve is actually simple, get a list of documents inside a specific folder in a Document library.
I dunno have any permissions on the Document library but i have full control on some folders inside that Document library.
Here is the code am using.
function RenommerDossier(Foldername) {
var myQueryString = "<View><Query><Where><Eq><FieldRef Name='Title' /><Value Type='Text'>" + Foldername + "</Value></Eq></Where><OrderBy><FieldRef Name='Title' /></OrderBy></Query>";
var MyUsername = 'Steve'
myDocLibrary = GetListByname("Documents des juges");//my custom function, works good
var context = new SP.ClientContext.get_current();
var query = new SP.CamlQuery();
query.set_viewXml(myQueryString);
var stringFullFolderUrl = 'MyDocumentLibrary/' + MyUsername + '/' + Foldername;
query.set_folderServerRelativeUrl(stringFullFolderUrl);
myFolders = myDocLibrary.getItems(query);
context.load(myFolders);
context.executeQueryAsync(
Function.createDelegate(this, this.OnLoadBibliothequeDossierSuccess),
Function.createDelegate(this, this.OnFailedLoadDossier)
);
}
If anyone could help i would be glad, thank you ;)