How to handle errors from custom business entity in KUIB - Forum - Kendo UI Builder - Progress Community

How to handle errors from custom business entity in KUIB

 Forum

How to handle errors from custom business entity in KUIB

This question is answered

Has anybody implemented custom errors within a business entity and figured out how to display them in KUIB?

I have a very custom business entity object with many rules that allow/deny create/delete/update of records.  In each case where an action is denied I'm setting ERROR and REJECTED on the before temp-table records and/or the after temp-table records.  I'm also setting the ERROR-STRING and then calling REJECT-CHANGES on the dataset.  None of this generates an error message on the KUIB app.

Also, in case this comes into play, my business entity is being accessed via a WebHandler on PAS, not a standard REST service.  The WebHandler converts the dataset to JSON to return the data to the client.  Since I had to code my own REST functionality maybe I need to add code in the WebHandler to pass the errors through?

Do I need to handle the errors differently in my business entity code?  Or do I need to add code to the KUIB app to handle the errors on the front end?

TIA

Louis Winter

Verified Answer
  • Edsel,

    I figured out the issue, and I apologize for the time you, Maura, and Shelley spent on this.  Because of an issue I was having early on with the popup editor, I added "grid.dataSource.read();" in a requestEnd event handler.  My custom error message was being returned but the extra call to read() was clearing it.  My error messages are now displaying correctly.

    Thanks for all your help!

    Louis

  • Edsel,

    I figured out the issue and the custom error messages are now being displayed correctly.

    Due to an issue I was having early on with the grid not refreshing when I selected Cancel on the edit popup, I added "grid.dataSource.read();" in a "requestEnd" event handler on my datasource.  This extra read() was clearing the error message(s) that were being returned.

    I apologize for the time that you, Maura, and Shelley spent on this issue.  It was a good learning experience though debugging this one.  Thanks for all your help!

    Louis

  • Edsel,

    I figured out my issue and the custom error messages are now being displayed correctly.

    Because of an issue I was having early on, I added "grid.dataSource.read()" to refresh the grid in a "requestEnd" event handler.  This was causing the error message(s) to be cleared.  I apologize for the time you, Maura, and Shelley spent on this.  Thanks for all your help!

    Louis

All Replies
  • Edsel,

    BINGO!  Your example response helped a bunch.  I did have extra data in the response, my create errors are now displaying correctly.  Thanks again.

    Louis