In an XtendM3 extension for an existing MI, how can you return a proper error message?
Hello,
We are creating an extension for an existing MI, for example MMS850MI/AddMove.
We would like to add some custom validation (for very customer-specific business logic), and fail the transaction if the validation fails.
The validation goes ok, and we can also abort the transaction.
This works ok when we call the MMS850MI/AddMove API.
However, we would like to return a meaningfull error message.
We are currently aborting the transaction with the following code:
transaction.abortTransaction("TWSL","","ToLocation is not allowed");
The 2nd argument is an M3 Message ID, which seems to be steering the complete error message.
When we fill in an existing message ID, such as WIT0102, the API show error message "Item number must be entered", which is the description associated with the WIT0102 Message ID.
So, our question is: how can we return our own error message?
Kind regards,
Alexander
Answers
-
Is this a new transaction? then you can use mi.error
0 -
Hi Prabodha,
Thanks for the tip. However, the mi class seems not to be available in the Trigger Extension (only in the Transaction Extension).
When I add MIAPI to the constructor, in Runtime I get a dumplog indicating that the MIAPI object can't be instantiated.Kind regards,
Alexander0 -
I think this is not possible in triggers.
0