Hi,
I am using a before save logic hook on a custom module. This hook makes API calls to do some work in other services related to the entry being created or updated. If these calls fail I would like to send and display a specific error message to the client. I have not been able to do this. Especially when editing a record. On create we use appendErrorMessage and a redirect but this does not work on updates. I also tried creating an “Alert” bean and that bean is persisted in the database but is never displayed to the user.
What seems to happen is that the client detects that there is an error and displays the message with the tag LBL_ERROR_SAVING.
As far as I can tell this is happening in angular in the file core/app/core/src/lib/views/record/store/record-view/record-view.store.ts.
The catchError function is triggered and the hard-coded message is displayed. I have looked at the objects available at that point and have not been able to get the error message down to those objects.
So is there a way to return error messages from a logic hook that can be displayed to the client? Just to be clear in this error case the changes should not be persisted.
I am using suiteCRM 8.2.0.
I have looked at a few other forum posts on this issue and so far they have not been helpful.
Any help would be great.
Thanks,
Bram