How to give SetFilter/SetRange on Line No.

yukon
Member Posts: 361
Hi Expert,
I want to give Setfilter or setrange at sales line table. My setfilter/setrange is base on "Line No.".
My Setfilter/setrange is base on user selected. But line no is integer return is code.
I give return value is code because of sometime line no are '10000...30000' or '10000|40000'.
How can i give filter by user selected line no? Please give me sugge:
Thanks And Regards,
Yukon
I want to give Setfilter or setrange at sales line table. My setfilter/setrange is base on "Line No.".
// 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
My Setfilter/setrange is base on user selected. But line no is integer return is code.
I give return value is code because of sometime line no are '10000...30000' or '10000|40000'.
How can i give filter by user selected line no? Please give me sugge:
Thanks And Regards,
Yukon
Make Simple & Easy
0
Comments
-
g_recSalesLine.SETRANGE("Line No.",g_codFilter); ---> This portion can't use, Line No. Integer
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?g_codFilter := '10000...30000|50000..70000' g_recSalesLine.SETfilter("Line No.",g_codFilter);
so, your filter workDo you make it right, it works too!0 -
Hi garak,
I got it. Thx 4 your help,
Regards, :whistle:Make Simple & Easy0 -
no problemDo you make it right, it works too!0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions