Below is the function and its fetching the Amount
and uno
but it throws an exception on clientContext.executeQueryAsync()
.
Here is the Code:
function delRec()
{
var uno;
var itemArray = [];
var listItemEnumerator = collListItem.getEnumerator();
var i=1;
var amount = 0;
var oListItem;
var d = new Date();
while (listItemEnumerator.moveNext())
{
oListItem= listItemEnumerator.get_current();
if(document.getElementById('check'+i).checked==true)
{
amount=amount + oListItem.get_item('Amount');
uno=oListItem.get_item('UniqueNo');
alert(uno+' '+amount);
oListItem.deleteObject();
oListItem.update();
itemArray.push(oListItem);
clientContext.load(itemArray[itemArray.length-1]);
alert(4);
}
}
clientContext.executeQueryAsync(
function (sender, args)
{
alert('record updated succesfully');
updateAmount(amount,uno);
//location.reload(true);
},
function (sender, args)
{
alert('Error: ' + args.get_message() + '\n' + args.get_stackTrace());
});
}
collListItem
isundefined
. If you expect us to be psychic and know what you other code is, then I fear you will get a very low response rate here on StackOverflowalert
to debug code. If you want to call yourself a programmer, go and learn to use the F12 Debugger Console... which... will help you find the errors yourself and save you from waiting for an answer here.