Forum Post: RE: jsdo AfterSaveChanges errorhandling

  • Thread starter Thread starter agent_008_nl
  • Start date Start date
Status
Not open for further replies.
A

agent_008_nl

Guest
Hi Edsel, I still do not have it working. The generated error is the same: somebeforebufferhandle:error = true. somebeforebufferhandle:error-string = "Orderstatus is verplicht". The output I get with the function copied below the output: The function I use: function saveChanges(action, dataArrayId) { var jsdo = dataModel.jsdo; jsdo.subscribe('AfterSaveChanges', function callback(jsdo, success, request) { jsdo.unsubscribe('AfterSaveChanges', callback, jsdo); if (success) { var dataReturned = []; jQuery.each(request.jsrecords, function(i, value ) { dataReturned.push(value.data); dataReturned ._idBefore = dataArrayId; }); eventManager.fireEvent(action + "-data", function(listener){ listener.listenerFunction(dataReturned); // jsdo.getData() }); } else { console.log(request.response[Object.keys(request.response)[0]]["prods:errors"]); jQuery.each(request.jsrecords, function(i, jsrecord) { console.log(jsrecord); console.log(jsrecord.getErrorString()); }); } }, jsdo); try{ jsdo.saveChanges(true); // true - use submit } catch (e) { console.log("Error executing function in dataModel.updateData: saveChanges, exception: " + e.message); } } When I use the latest jsdo from https://github.com/CloudDataObject/JSDO (download today) I get the following exception: saveChanges requires CREATE, UPDATE and DELETE operations to be defined. while saveChanges is called with param true?! Any idea what goes wrong? Thanks, Stefan.

Continue reading...
 
Status
Not open for further replies.
Back
Top