Hi,
Does anyone know how to customise Navision in order to make it auto posting for invoice.
The scenario is this. A customer of mine using a thrid party point of sals system and update into a staging table (temp table in SQL). We need to trigger the sales records and payment info to update into NAvision sales invoice header, invoice line and payment journal. After that the system should auto post the transaction into relevant ledgers.
Anyone has done this?
Thank you
0
Comments
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
Kine is right, the main issue is handling errors.
You'll need to know the basics about Navision's error handling, and you do that by searching the forums here.
Finally, when writing an automated posting routine, you'll probably have to remember to write some code to bypass the internal commits in codeunit 80.
Thanks
In the "OnRun" you enable the timer.
Then in function
In function "CheckSQLTempTable" you can check if some new records are available (do a LOCKTABLE, because you can read uncommited data with SQL). With these records you can create records in the Navision tables (using VALIDATE and other triggers) and then you can post them.
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
How would you know the invoice number, so you can put it in a temp table to upload to the third party system? \:D/
I would like to share with you some info about what I am currently working lately for a customer and has to do with NAS and posting.
I am building an interface with an application that creates records in a custom navision table and I have a NAS that reads that table, creates journal lines and dimensions and posts that journal to G/L, customers, Vendors and Cheques... The interface will be able to handle a few thousands of transactions per day (invoices, payments, cheques)...
I have found that timer error routine in the NAS cu is very helpfull because for every problem that occurs it sends the error back...
I have used two tables for the communication, one IN and one OUT.
Whenever everything succeds I move the record I have processed from the IN table to the OUT table marked as valid, but if an error occurs then I move that rec in the OUT table with valid=false and putting the error message in a field there...
One of the problems where the COFIRM executions in various places in Nav was called. Of course I used the IF GUIALLOWED THEN ...
The 80% of the code in my cu is error checking of amounts, existance of customers/vendors, valid dimension values, e.t.c.
It was rather paifull and difficult to implement, especialy the debugging (because of the NAS) but it is almost over... For the debugging I usually run the cu manualy from the object designer and my client works as a nas, (with user interface of course and shows me the dialogs) but it is the only way I can do a proper debugging...
Just don't forget to make a large delay on the timer when debugging so that you don't enter a loop with the repeating of the cu calling with the timer lol... #-o
Alot of times I had to "End Task" my nav client to be able to exit the debugger...
I have also made a log table that reports whatever is going on and in addition counts the milliseconds that each operation takes to create and post. If some wants when I get proper statistics of journal posting with nas i will post them here...
Arhontis
https://forum.mibuso.com/search
I've just done something similar. When the user creates a whse shipment it exports a text file that gets read by a seperate Freight program.
When the shipment is value of the freight Cost/Price is returned to Navision added as a line to the original order and automatically posted.
The posting routine was throwing up Window (Dialog Box) was one error that I had but the most annoying was the Dead Locking caused by the Document Dimension table. NAS had a problem where if it fell over due to deadlocking it could not recover itself. There is a hotfix for this.
As for the Document Dimension deadlock issue, I went into the DimensionMgmt CU and for all the functions that delete dimenisions there was
It needed to be changed to
To ensure a correct lock.
That solved the issue.
So thats some of my experiences I hope they help out!
I needed to chan