find out what item id failed executeQueryAsync item creation

550 views Asked by At

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 !

0

There are 0 answers