// Sales Line // User Selected Line // Return Selected Line No. CurrForm.SETSELECTIONFILTER(l_recSalesLine); LineCount := l_recSalesLine.COUNT; IF LineCount > 0 THEN BEGIN l_recSalesLine.FIND('-'); WHILE LineCount > 0 DO BEGIN LineCount := LineCount - 1; l_recSalesLine.MARKEDONLY(FALSE); l_intFirstLine := l_recSalesLine."Line No."; l_intLastLine := l_intFirstLine; l_blnMore := (LineCount > 0); WHILE l_blnMore DO IF l_recSalesLine.NEXT = 0 THEN l_blnMore := FALSE ELSE IF NOT l_recSalesLine.MARK THEN l_blnMore := FALSE ELSE BEGIN l_intLastLine := l_recSalesLine."Line No."; LineCount := LineCount - 1; IF LineCount = 0 THEN l_blnMore := FALSE; END; IF l_codSelectionFilter <> '' THEN l_codSelectionFilter := l_codSelectionFilter + '|'; IF l_intFirstLine = l_intLastLine THEN l_codSelectionFilter := l_codSelectionFilter + STRSUBSTNO(l_Text0001,l_intFirstLine) ELSE l_codSelectionFilter := l_codSelectionFilter + STRSUBSTNO(l_Text0001,l_intFirstLine) + '..' + STRSUBSTNO(l_Text0001,l_intLastLine); IF LineCount > 0 THEN BEGIN l_recSalesLine.MARKEDONLY(TRUE); l_recSalesLine.NEXT; END; END; END; EXIT(l_codSelectionFilter); // CurrForm.SETSELECTIONFILTER(p_recSalesLine); // Button OnPuch g_codFilter := CurrForm.SalesLines.FORM.GetSelectionFilter; g_recSalesLine.SETRANGE("Document No.",g_codSOrderNo); g_recSalesLine.SETRANGE("Line No.",g_codFilter); ---> This portion can't use, Line No. Integer
Comments
Ok, your function is based, for example, on the function GetSelectionFilter() in form 22. OK, no problem. The function is ok. You find out, that the setrange command requ. an integer variable, because the field to filter is integer.
But, why do you not use setfilter(FIELD,STRING) command?
so, your filter work
I got it. Thx 4 your help,
Regards, :whistle: