Hello everyone.

I am struggling with a sharepoint project containing Ajax query. I am fairly new in C#/Ajax/Sharepoint development and don't a clear understanding.

I am working on a bug. The scenario is as following. There is a small form which is saving information or is supposed to save information. Instead I am getting an error

Sys.ArgumentUndefinedException: Value cannot be undefined. Parameter name:method

The last code line from following is causing the error

function saveOrderSucceeded(sender, args) {

if ($("#" + ddOrderLiftingId).val() != "") {
try {

var list = currentWeb.get_lists().getByTitle('Person');
var listItem = list.getItemById($("#" + ddOrderLiftingId).val());
currentSPContext.load(listItem, 'WorkPhone', 'CellPhone');
currentSPContext.executeQueryAsync(Function.createDelegate(listItem, function () {
var item = this.get_fieldValues();
var phoneNumbers = [];

if (item.WorkPhone != null)

if (item.CellPhone != null)

if (phoneNumbers.length > 0)
$("#" + orderLiftingPhoneId).html("Phone. " + phoneNumbers.join(", "));

Function.createDelegate(this, this.ajaxQueryFailed)); //error occurs in here. Below is the function where this is pointing to.


function ajaxQueryFailed(sender, args) {

I debugged this by using Firebug and it shows that 'ajaxQueryFailed', when executed is 'undefined'. I don't know how to start solving this. Help would be appreciated.

Thanks in advance.