2

When I create a new record in WorkEffort and when I provide the workEffortId that already exists, then an error message displayed is:

(Error in update for:INSERT INTO WORK_EFFORT (WORK_EFFORT_ID, WORK_EFFORT_TYPE_ENUM_ID, STATUS_ID, WORK_EFFORT_NAME, DESCRIPTION, LAST_UPDATED_STAMP) VALUES (?, ?, ?, ?, ?, ?))

Now I want to show a customized error message to user instead of the technical one above, like : "This workEffortId already exists".

Thanks in advance :-)

1 Answer 1

0

Just write a bit of code to check for the error condition, and then add an error message to the MessageFacade error list. In Groovy code this would be something like ec.message.addError(...) or .addValidationError(...). In XML Actions you can use the message or return action elements to do this (a return with error="true" plus a message is the most common way to do this in a service, for example).

For more details see the MessageFacade API JavaDoc and the XML Actions schema documentation on moqui.org, or the relevant sections in the Making Apps with Moqui book.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.