[progress Communities] [progress Openedge Abl] Forum Post: Re: How To Handle Errors From...

  • Thread starter Thread starter jts-law
  • Start date Start date
Status
Not open for further replies.
J

jts-law

Guest
Edsel, Disclaimer: I'm not 100% sure that I have everything setup "the right way", I've still been hacking at it to make it work. Business entity/web handler setup: I created a WebHandler class with methods to handle Get, Post, Delete, Patch, and Put. Within the "Put", I have logic for my different invoke operations as well as the submit. All WebHandler methods call the same methods as the REST wrapper class does. One thing I'm not sure of is when I fill the dataset in the WebHandler class, which read-mode to use, I'm currently using "EMPTY". Another "opportunity" with using a WebHandler is generating the schema json file. To create the schema json file I generated a file using a REST service, copied the file, and changed the URI references. This seems to be working so far. Answers to questions: >Are you using the Submit operation? (The JSDO/Kendo UI DataSource automatically uses Submit if it is present in the Business Entity.) Yes, all operations are using the submit. I wasn't sure why but you just answered that. >Are you sending multiple creates, updates and deletes in a single request via the Submit operation? In the current view, each operation is a single record. I'm using the Add button above the grid for adds, and the Edit and Delete buttons on each row individually. The selection type on the grid is set to "None". >If sending multiple updates, what transaction model are you using on the server? Not currently sending multiple updates. >A single transaction for all the updates or separate transactions for each update? If we allow multiple updates on future views, the plan will be to group all updates into a single transaction (all or none). Also, I have run into another issue with my error messages. Updates are working correctly but errors when adding new records doesn't work at all. My business entity is generating an error when adding a new record, but no error message displayed in KUIB app. As you can see below, the JSDO logic is expecting before-image information but the create is not generating any. When debugging code - Exception thrown in "_mergeUpdateForSubmit" in "if (!recordId)" statement. Exception caught in "onReadyStateChangeGeneric". Trace: Error: JSDO: In '_mergeUpdateForSubmit()' function, before-image JSON data is missing prods:clientId at JSDO._mergeUpdateForSubmit (progress.jsdo.js:5900) at XMLHttpRequest.JSDO._saveChangesSuccess [as onSuccessFn] (progress.jsdo.js:6291) at XMLHttpRequest.JSDO.onReadyStateChangeGeneric (progress.jsdo.js:6726) Additional info from "catch(e)" block of "onReadyStateChangeGeneric" function. I can see my error message in _errorString. >request.jsrecords[0].data description: "Test 2" group2_description: "" group3_description: "" group_description: "" key_id: "Br" key_type: "Int" key_value: "9" prods:clientId: "1495547858926-2729" prods:hasErrors: true prods:id: "ttLookup24832" prods:rowState: "created" _errorString: "Unable to create, parameter already exists: Br, 9" >request.success true If I set request.success to false via the debugger, the "Error while saving changes." message is displayed, but still no custom message. Let me know if you would like any additional information. Louis

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