If it works and stops working after some time then it is likely some NST bug. If restarting the NST helps it only confirms that hypothesis.
You could try SELECTLATESTVERSION before SETRANGE, to try to workaround the problem. The SELECTLATESTVERSION will clear session buffers and reduce memory pressure, which might help if problems are somehow related to memory.
Regardleds the SELECTLATESTVERSION helps or not try the newest CU, and report the bug to Microsoft
Thanks for the feedback. I was curious if it could help.
Looking at the code you posted above - is this related anyhow to the test page you've shown? I mean is this just a snippet of the code used on the test page to filter someting, or you have build the page is just to demonstrate the problem, and the sample code posted later is from another place in the system?
Can I ask what version/cumulative update you are using?
I have seen this issue. It appears to apply to all virtual tables , not just the date table and is a NST bug. Restarting the NST resolves the issue. The issue appears to be caused by making objects changes and therefore I have only seen this in a development environment and not on any production environments.
Answers
Blog - rockwithnav.wordpress.com/
Twitter - https://twitter.com/RockwithNav
Facebook - https://facebook.com/rockwithnav/
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-03
@Slawek_Guzek
It also work for my machine. Restart NAV server helps, but after some time it will occure again.
You could try SELECTLATESTVERSION before SETRANGE, to try to workaround the problem. The SELECTLATESTVERSION will clear session buffers and reduce memory pressure, which might help if problems are somehow related to memory.
Regardleds the SELECTLATESTVERSION helps or not try the newest CU, and report the bug to Microsoft
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-03
Looking at the code you posted above - is this related anyhow to the test page you've shown? I mean is this just a snippet of the code used on the test page to filter someting, or you have build the page is just to demonstrate the problem, and the sample code posted later is from another place in the system?
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-03
I have seen this issue. It appears to apply to all virtual tables , not just the date table and is a NST bug. Restarting the NST resolves the issue. The issue appears to be caused by making objects changes and therefore I have only seen this in a development environment and not on any production environments.