Hi everyone,
I have been writing NAV code for a while now but I am aware that in many cases, my code isn't really good when it comes to performance.
I am wondering if there are any articles or books or special hints you can recommend me for coding better performance?
Thanks in advance
Comments
Sr. Project Manager
S-Metric, LLC
jsung@smetric.com
Depends on which NAV version you are. Using FINDSET for every loop could not be optimal e.g. in NAV 2013+ it is better to use FIND('-') if you are supposing to break the loop before you go through all records etc. You need to understand the behavior behind the command to be able to choose correct one. You can study the blogs about this, attend conferences etc.
Even the thing about setcurrentkey is not true for a long time already. It was true for Native DB, not true for SQL, but sometime good on some versions even on SQL (when dynamic cursors were used if I am right...).
Do not forget that this is changing not only by each NAV version, but sometime even with NAV build....
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
Didn't know about find('-') with break in the loop, will check that, but if we want to loop through whole set then findset should be used.
Regarding setcurrentkey, it only sets ordering of SQL query, so Yes, it should be used with knowledge of particular table and its indexes, and keeping in mind which filters are applied.