To avoid unnecessary DB traffic I want to do GlSetup.GET only once because it is Global variable (GlSetup is "General Ledger Setup" tables) but there is no way to detect for a Record variable that Record.GET has been already executed.
(I need GlSetup to handle validation triggers for some fields in another table)
I could use some GetFlag boolean variable to set it TRUE after GET statement but is there any more convenient way?
(ISEMPTY, COUNT, GETPOSITION are useless, Table GlSetup has Primary key always blank, etc)
Best Regards,
Amer
0
Comments
for example
function GETGLSetup()
if not TempGLSetup.get then begin
GLSETUP.get;
TempGLSetup := GLSETUP;
TempGLSetup.insert;
end;
This way you can use TempGLSetup and all you have to do is call GETGLSetup everywhere.
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
RIS Plus, LLC
RIS Plus, LLC
He never said that you should replace all FIND('-') with FINDFIRST.
He said in examples such as that, it is possible.
RIS Plus, LLC
I am not so sure. Try to use Client Monitor or SQL profiler. Every time I issue GLSetup.GET(), there are at least two DB messages.
I agree that Nav produces pretty traffic but NAV also used to avoid it whenever it is possible.
Proof is: as DenSter Quoted example:
Obviously, boolean variable is the best way.
If you all agree, maybe they should implement above structure in something like GETCASHED because setup tables (with one row only and read purpose) are pretty frequently used in code(just to save coding).
Thanks!
Best Regards,
Amer
When i use the client monitor a GET is less than 1 ms.
I completly agree with Black tigger
You just need to do the get before your loop for a get on a setup table.
But do better attention with the FIND and FINDSET and the keys
regards.
RIS Plus, LLC
of course, you may not save the record.
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n