Hello
I have an old 3rd party application that writes Sales Orders into some bespoke tables in our NAVISION V4 database. The 3rd party application inserts the Sales Orders into NAV using a SQL Stored Procedure. I can alter the Stored Procedure but can't alter the 3rd party application.
We are currently upgrading to NAV2017 and have found that the NAV2017 Menu tiles (bespoke tiles provided by our partner) don't update their counts to reflect the number of open Sales Orders written by the Stored Procedure. If I create the records directly in the NAV table, the tile counts are correct. I think the issue is something to do with the timestamp.
What's the best approach to resolve this? Options I can think of are:
1 - Create a NAV Web Service and a SQL CLR Stored Procedure
2 - Amend the existing stored Procedure so that it updates the timestamp (have had a play with this and can't find a way to do it)
3 - Write something in NAV that checks the Order table every minute or so and updates a Boolean field on the table (new field called something like Time_Stamp _Updated). This will update the timestamp and then make NAV aware of the order.
4 - Alter the Stored Procedure so that orders are written to a staging SQL database (outside NAV). Create a SQL job that periodically exports the orders to an XML file. Create a NAV XMLPort to import the orders. Create a NAV job that periodically runs the XMLPort.
Many Thanks
0
Answers
Have a codeunit create the real order and schedule this.
NEVER insert data into NAV via SQL, there are tons of validation code and related data written in the process of creating a sales order!!!
The issue is related to NAV data cache
As @Juhl said
Inside this codeunit use the function SELECTLATESTVERSION