I have a jqGrid that shows records from a database, users can select one or more to make a copy of those in a list in our site. In my case I had to implement error handling to let users know when the record they choose to create already existed.
Let me try to explain, it was very annoying at the beginning because there was no error message and the record "sometimes" got to the list and other times didn't. I found a 0x80040e2f error value in the ErrorCode tag and doing a deeper search in Google found that the "Title" field value cannot be repeated (preexist in the list), it works like a unique key. Strange thing to see that if you try to create a repeated record (having the same value for the "Title" field) using the New Form for the list you will not get this error.
Let me try to explain, it was very annoying at the beginning because there was no error message and the record "sometimes" got to the list and other times didn't. I found a 0x80040e2f error value in the ErrorCode tag and doing a deeper search in Google found that the "Title" field value cannot be repeated (preexist in the list), it works like a unique key. Strange thing to see that if you try to create a repeated record (having the same value for the "Title" field) using the New Form for the list you will not get this error.
completefunc: function(xData, Status) {
var errXML = xData.responseXML;
var errRows = errXML.getElementsByTagName("ErrorCode");
if(jQuery(errRows).text() === '0x80040e2f') {
alert('The record you selected cannot be created because it already exists in the list');
return false;
} else {
// continue redirecting the user to the recently created record.
}
}