Copy Filters one by one

txeriff
Member Posts: 515
Hi all,
Hope you can help. Here it goes:
What I try to do is the following:
-Tobject recordref "reads" the field number defined in T50006."Field No."
-Then tField is used to filter T50006."Filter Expresion"
-Value is set to T27B and then that value must be added to the filters in T27, added, not overwritten as we are into a loop.
Example of a row I would like to filter:
-T50006."field no."=1 //it would be Item.No.
-T50006."Filter Expresion"='1000' //it would try to filter item 1000
-then the value goes to T27B and copied to T27
How do I add the value to T27 without overwriting previous filters? As far as I know copyfilters overwrites and I can´t use (or I don´t know how to) copyfilter as I must provide source a field, not a fieldref.
Any ideas?
many thanks!
Hope you can help. Here it goes:
T50006.RESET; T50006.SETRANGE("Setup No. Sequence",T50005."No. Sequence"); IF T50006.FINDSET THEN REPEAT //create a "filtered" T27 so we can send it to the report and copy //filters to dataitem tobject.open(27); tfield:=tobject.field(T50006."Field No."); TField.SEtfilter(T50006."Filter Expresion"); tobject.settable(T27b); t27.copyfilters(t27b); //does it overwrite??? UNTIL T50006.NEXT=0;
What I try to do is the following:
-Tobject recordref "reads" the field number defined in T50006."Field No."
-Then tField is used to filter T50006."Filter Expresion"
-Value is set to T27B and then that value must be added to the filters in T27, added, not overwritten as we are into a loop.
Example of a row I would like to filter:
-T50006."field no."=1 //it would be Item.No.
-T50006."Filter Expresion"='1000' //it would try to filter item 1000
-then the value goes to T27B and copied to T27
How do I add the value to T27 without overwriting previous filters? As far as I know copyfilters overwrites and I can´t use (or I don´t know how to) copyfilter as I must provide source a field, not a fieldref.
Any ideas?
many thanks!

0
Comments
-
I don't have NAV in front of me, but something like this should work...
T50006.RESET; T50006.SETRANGE("Setup No. Sequence",T50005."No. Sequence"); IF T50006.FINDSET THEN BEGIN tobject.gettable(t27); REPEAT tfield:=tobject.field(T50006."Field No."); TField.setfilter(T50006."Filter Expresion"); UNTIL T50006.NEXT=0; tobject.settable(t27); END;
0 -
thanks, it worked. I had the solution right there I guess I was tired. hehe.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