0

How can i find what item failed executeQueryAsync add item method ?

this is my code :

var itemArray = [];
var siteUrl = "http://MySite/MM/cm";
var clientContext = SP.ClientContext.get_current();
var oList = clientContext.get_web().get_lists().getByTitle('xy');

var itemCreateInfo = new SP.ListItemCreationInformation();
oListItem = oList.addItem(itemCreateInfo);
oListItem.set_item('FullName', "ali");
oListItem.set_item('CellPhone', "555-666");

oListItem.update();
itemArray[i] = oListItem;
clientContext.load(itemArray[i]);

clientContext.executeQueryAsync(onQuerySucceeded, onQueryFailed);

function onQuerySucceeded() {
    console.log("item created in : ", oListItem.get_id());
}

function onQueryFailed(sender, args) {
    console.log('Request failed. ' + args.get_message() + '\n' + args.get_stackTrace());
}

I con not find out what item is duplicate in item creation that my query is failed ! if i can find it then i can update it and continue with others !

alireza
  • 1,173
  • 4
  • 19
  • 40
  • what is your broblem? what is a message on failed? – WantToDo Jan 08 '17 at 16:15
  • solved : [find out what item id failed executeQueryAsync item creation](http://sharepoint.stackexchange.com/questions/204191/find-out-what-item-id-failed-executequeryasync-item-creation) – alireza Jan 09 '17 at 05:06

0 Answers0