Hi, I'm using Navision 4.0 sp1. In a report, I have a roundloop of table 39 (Purchase Line). In the report, how do I hide lines with "No." = 'XYZ-00*' ( * means there might be other chararcter at the back)?
If the No. = 'XYZ-0011*' or 'XYZ-0099', the line will not appear.
However, if the Document No = 'XYZ-0900', the line will appear.
Can anyone help me with the coding?
RoundLoop - On AfterGetRecord()
SETRANGE(Number,1,PurchLine.COUNT);
intPos := 1;
IF Number = 1 THEN
PurchLine.FIND('-');
ELSE
PurchLine.NEXT;
IF (PurchLine."No." = ???????? ) THEN // I try (PurchLine."No." = 'XYZ-09*' ) but not success.
intPos := intPos + 1;
IF (PurchLine."No." = ???????? ) THEN // I try (PurchLine."No." = 'XYZ-00*' ) but not success.
CurrReport.BREAK; <--I just break the report when it found 'XYZ-00*'
END;
0
Comments
try to compare only the first part of the number with your search string. Like
With this COPYSTR you take a substring from Position 1 and Length 6 to compare...
Like why not apply the filter on the record variable directly? Why you are iterating through all lines, when you want only which are different form your filter? Why you are using CurrReport.BREAK when you want to just SKIP the record?
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
My Blog - nav.education