Hi there,
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.
"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 fine.
The big problem emerged when errors occur after that. My message shows the "Document No." but then the error stops the entire process.
I'm trying and trying but I can't find the last step of the posting routine in order to place the C/AL code for that message at the very end of it all.
Can anybody help me?
Thanks in advance.
P.S.: I placed the code in the Codeunit 12 "Gen. Jnl.-Post Line".
Redcodestudio: Web Development, FLASH & Webdesign (and a little NAV, in the future) 0
Answers
Try putting your message in codeunit 80 - at the bottom of the onrun function
EDIT: Nope, not working. I've posted a Sales Invoice and a Sales Credit Memo and that message does not appear.
http://ssdynamics.co.in
I'm studying this posting routine to see the big picture here.
RIS Plus, LLC
MVP - Business Apps
The printed document will show the posted document number.
AP Commerce, Inc. = where I work
Getting Started with Dynamics NAV 2013 Application Development = my book
Implementing Microsoft Dynamics NAV - 3rd Edition = my 2nd book
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.
Again, programming messages directly in the posting routines is a very bad development practice. The very reason for the Yes/No posting codeunits is to ensure that there are no messages in the posting routines themselves.
RIS Plus, LLC
MVP - Business Apps
I was forgetting the basic, lol. Go to the table and check if it is posted, then show the message.