Filter table with copyfilter

fernandojsdias
Member Posts: 5
Hi,
I have on problem, I need to filter the item table from the result of filtering other table.
The code is this, I am trying to avoid the "ItemFilter" variable.
IF (Rec."NO ProdGruppe" <> '') AND (Rec."Item No." = '' ) THEN BEGIN
Group.RESET;
Group.SETRANGE(Group,Rec."NO ProdGruppe");
IF Group.FINDFIRST THEN BEGIN
Paragraph.RESET;
Paragraph.SETRANGE("Reimbursement Paragraph",Group."Reimbursment Paragraph");
IF Paragraph.FINDSET THEN
REPEAT
IF ItemFilter <> '' THEN
ItemFilter += '|'+Paragraph."Item No."
ELSE
ItemFilter := Paragraph."Item No.";
UNTIL Paragraph.NEXT = 0;
Product.SETFILTER("Product ID",ItemFilter);
SearchPage.LOOKUPMODE(TRUE);
SearchPage.LoadRecords(Product,Item,Rec."Type of Pick");
in the loadrecords I have a copyfilters from Product then I open the page with the result of the filter of copyfilters.
does anyone knows a way to do this?
I have on problem, I need to filter the item table from the result of filtering other table.
The code is this, I am trying to avoid the "ItemFilter" variable.
IF (Rec."NO ProdGruppe" <> '') AND (Rec."Item No." = '' ) THEN BEGIN
Group.RESET;
Group.SETRANGE(Group,Rec."NO ProdGruppe");
IF Group.FINDFIRST THEN BEGIN
Paragraph.RESET;
Paragraph.SETRANGE("Reimbursement Paragraph",Group."Reimbursment Paragraph");
IF Paragraph.FINDSET THEN
REPEAT
IF ItemFilter <> '' THEN
ItemFilter += '|'+Paragraph."Item No."
ELSE
ItemFilter := Paragraph."Item No.";
UNTIL Paragraph.NEXT = 0;
Product.SETFILTER("Product ID",ItemFilter);
SearchPage.LOOKUPMODE(TRUE);
SearchPage.LoadRecords(Product,Item,Rec."Type of Pick");
in the loadrecords I have a copyfilters from Product then I open the page with the result of the filter of copyfilters.
does anyone knows a way to do this?
0
Answers
-
You can avoid the filter bij marking the item records in the paragraph loop.
Then set markedonly(true) to this record before running the lookup page.
Settableview first.0 -
I already think in that solution, but the problem here is that I used the same page for other processes and the source table of the page is a temporary table, the records are created with the filters.
Thanks anyway0 -
Well why don't you fill a temp item rec with items in the loop, pass the temp rec as var tot the page. Then use copy(sourcetavle,tempitem,true) in the page to create the temp records in the source table.0
-
hello i should rewrite the repeat as following:
IF (Rec."NO ProdGruppe" <> '') AND (Rec."Item No." = '' ) THEN BEGIN Group.RESET; Group.SETRANGE(Group,Rec."NO ProdGruppe"); IF Group.FINDFIRST THEN BEGIN Paragraph.RESET; Paragraph.SETRANGE("Reimbursement Paragraph",Group."Reimbursment Paragraph"); IF Paragraph.FINDSET THEN Begin REPEAT IF Product.get(Paragraph."Item No.")THEN Product.Mark(TRUE); UNTIL Paragraph.NEXT = 0; END; Product.reset; Product.Markedonly; SearchPage.LookupMode(true); Searchpage.Settableview(Product); SearchPage.Run; ..... End; End;
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