I was asked to place a message at the end of every posting routine for a series of documents (like Invoices and Credit Memos) stating the “Document No.” that was used to post it to the “G/L Entry” table in order to inform the user of that fact. “This Invoice/CM was posted with the Document No. INV-001”.
But I’m having a problem in achieving this.
The posting routine starts and shows the progress information. If there is an error in filling out the form, the routine stops and my message does not appear. That’s my goal.
The big problem emerged when errors occur after checking if the form header is filled out ok. My message shows the “Document No.” first but then the error message appears and stops the entire process (the document isn’t posted).
I’ve learned that one must not place the message in the posting routines themselves, but in the very object that calls the posting routine. I did that.
But the issue is that, when there’s an error of somekind (like choosing a non existent bank account for the “Payment Method Code” field in the “Purchase Credit Memo”) that information message (with the post “Document No.”) stills shows up after the error message (when the process should stop right there), taking the user to think that even though there was an error the document was still posted.
I need the information message to only show in the last step of the routine, if there are no errors.