Like the title implies.
I'm thinking I'd like to try this:
IF Record.COUNTAPPROX < "Record Set" THEN BEGIN
IF Record.FINDSET THEN
REPEAT
DoSomething;
UNTIL Record.NEXT = 0;
END ELSE BEGIN
IF Record.FIND('-') THEN
REPEAT
DoSomething;
UNTIL Record.NEXT = 0;
END;
I'm guessing there's a good answer why this is a bad idea since I don't see it being done as a regular practice, or can I just not access that Record Set value?
Comments
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
From this article:
After reading this, it sounds like the big question between a FINDSET and FIND('-') is guessing how many records will be returned. From what I've absorbed so far, this is a 'gut feeling' and you essentially hard code which search you are going to use.
So, I ask the question: Can we use COUNTAPPROX to do an educated guess on the number of records, then determine which search method to use? Maybe things don't work that way, but I'd like to make sure I know the answer
Systems Analyst
NAV 2009 R2 (6.00.34463)
For me the real question is, if I can expect theoretically unlimited count of records, I will use the FIND (ledger entries etc.) but if you are working with limited record set (e.g. lines of one document, they will be never unlimited), I preffer FINDSET.
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
From Microsoft:
I'm thinking more in situations where you don't know what the user is going to filter on, which may affect your record set.
Imagine filtering on sales lines - if you are filtering a day or week's worth of lines, FINDSET might be appropriate. However, what if the user gets wild and sets the filter for a month or a quarter? Now you wish you had used FIND!
Systems Analyst
NAV 2009 R2 (6.00.34463)
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
Systems Analyst
NAV 2009 R2 (6.00.34463)
Personally, I have not seen many cases in which there is a big performance difference between FIND and FINDSET.
RIS Plus, LLC
This is the conclusion
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.