Hello
We are upgrading from NAV2009 to NAV2016 and taking the opportunity to tidy a few thinks up. Current Setup:
1 - We take Orders from our customers using an external system and these orders are saved to bespoke tables in NAV (not standard Sales Order Tables!)
2 - We send the orders to a single distributor via EDI
3 - Distributor delivers the goods
4 - Distributor sends us a daily EDI file containing 'delivered' data.
5 - We import the EDI file and this creates "Staging Documents" that are matched to the Sales Orders in step 1
6 - The "Staging Documents" are posted to create a batch of Sales Invoices
7 - Sales Invoice batch is Posted
The Staging Documents are comprised of:
Header Table, Line Table, Dimension Table
For the Staging process, do I still need the Dimension Table or should I add a Dimension Set ID field to the Line Table records instead?
Currently, step 6 is quite complicated and I am struggling to debug it. If I were to start step 6 again, what would be the best approach to create the Sales Invoices?
Many thanks
0
Answers
Re step 6 - what is the problem exactly? I would do the following...
1) Have a codeunit "Post Staging Document" - this will post 1 staging document - you pass the Header Table in the OnRun trigger
2) Have a codeunit "Batch Post Staging Documents" - this will loop through the Staging Document Headers and call the "Post Staging Document" codeunit for each one. I would do this in a loop and include error handling, something like...
I was expecting the existing process would JUST populate the Sales Invoice Header & Line tables with the staging data. However, it's also creating General Journal Lines. Any ideas as to why it would be creating General Journal Lines?
Thanks