Hi,
I have some problems with the SETSELECTIONFILTER on a subpage in RTC. I need to find the Sales Lines that the user have marked, and send them to a report afterwards. So, on Page 42 Sales Order I have a button with the code.
CurrPage.SalesLines.FORM.OpenCopyCalcLines;
And on the Sales Order Subform I have the following code:
CurrPage.SETSELECTIONFILTER(SalesLine);
IF SalesLine.FINDSET THEN
REPEAT
MESSAGE(FORMAT(SalesLine."Line No."));
UNTIL SalesLine.NEXT = 0;
My problem is that the message about the line selected is always one step behind. E.g the user selects Line No. 10000. Then the message shows the lines that were marked before. Then when the user selects a new set of lines it will then show Line No. 10000, which was selected previously.
What the heck am I doing wrong?
Answers
CurrPage.SETSELECTIONFILTER(SalesLine);
SalesLine.MARKEDONLY(TRUE); // I think you forgot to write this line.
IF SalesLine.FINDSET THEN
REPEAT
MESSAGE(FORMAT(SalesLine."Line No."));
UNTIL SalesLine.NEXT = 0;
Hope this will solve your problem.
Thanks & Regards,
Purvesh Maisuria.
Please stay tuned for the final NAV2013 release :
Troels Bent Hansen
Senior Program Manager
Microsoft Dynamics NAV
****** This posting is provided "AS IS" with no warranties, and confers no rights ******
As far as I know markedonly does not work in NAV2009 under RTC.
But what is the best approach to handle these scenarios? The user selects a few lines on a subpage, and we as coders wants to handle these lines - send them to a report or codeunit or whatever?
TIA
Troels Bent Hansen
Senior Program Manager
Microsoft Dynamics NAV
****** This posting is provided "AS IS" with no warranties, and confers no rights ******
Peter
Check this out: https://community.dynamics.com/nav/b/vi ... round.aspx