Hello,
I'm running NAV 2018 CU1 and ran into the following problem.
I updated a record in the NAV database via SQL statement but my NAV client did not get the updated data.
How to reproduce
- Open NAV demo database with development environment
- Create a CU with following code:
<blockquote>
Location : Record 14
Location.get('BLAU');
Message('%1',Location.Name);
</blockquote>
- Run Codeunit. Result = "Blaues Warenlager" (in german demo database)
- DO NOT CLOSE THE development environment
- run following statement on the NAV demo database
select Code,Name from [CRONUS AG$Location] where Code = 'BLAU'
update [Cronus AG$Location] set Name = 'Hello World'
select Code,Name from [CRONUS AG$Location] where Code = 'BLAU'
- Result: Location name is changed to 'Hello World'
- Run the Codeunit from step 2 again
- Result: Name is still "Blaues Warenlager"
You two options now
1. restart Service tier
2. open the table and press F5 to reread the records
Is there a way to force the service tier to reload the data from the database without restarting it?
Regards
Benjamin
Answers
Try calling SELECTLATESTVERSION, it clears the session cache. It may help, but if you use it too much you will slow down your system by forcing the NST to reread the data.
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-03
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-03