What to return on error with MultiRow processing

I’ve got the following code

	dpBkgData = new dataProcessor("/bookingitem/updateprepaybkgitems/"+CurrUserID);
	dpBkgData.setUpdateMode('off');
	dpBkgData.enableDataNames(true);
	dpBkgData.setTransactionMode('POST',true);
	dpBkgData.attachEvent("onAfterUpdate",afterUpdatePrepayBkgItems);
	dpBkgData.init(grdBkgData);
	dpBkgData.defineAction('updateprepaybkgitemserror',updatePrepayBkgItemsError);

If an error occurs at the Server side I do not update any rows i.e. Server action is wrapped in a ‘Transaction’. I return the following xml:

<data>
  <action sid="142" tid="142" type="updateprepaybkgitemserror" errmsg="Error saving data 
No records saved"/>
  <action sid="143" tid="143" type="updateprepaybkgitemserror" errmsg="Error saving data 
No records saved"/>
</data>

My function for ‘updatePrepayBkgItemsError’ is :

	function updatePrepayBkgItemsError(sid,response)
	{
		alert(response.getAttribute('errmsg'));
	}

However the ‘response’ has a null value.

Please can you tell me what I should return in this situation and what should I expect as parameters to function updatePrepayBkgItemsError.

Thanks
Purvez

Format of response is valid.

How is updatePrepayBkgItemsError attached to the dataprocessor?

If you are using defineAction - then signature of your custom function must be

function updatePrepayBkgItemsError(response) { alert(response.getAttribute('errmsg')); }

Thanks Stanislav, that worked. In this situation do I still have to return ALL the rows that were originally sent to the Server or can I restrict it to the row/rows that are in error?

You need to return all rows ( they may have different status messages, but must all present in response )

I understand. Thanks for your prompt response.

Purvez