Setrange with another table

sharon95
Member Posts: 183
How can I filter a table based on a set of values of another and different table?
for example.
Table1.setrange(name, "peu*");
Table2.setrange(name,Table1.name)...
Thank you!
for example.
Table1.setrange(name, "peu*");
Table2.setrange(name,Table1.name)...
Thank you!
0
Answers
-
Have you looked into COPYFILTER function?
https://msdn.microsoft.com/en-us/library/dd355214.aspx0 -
yes, but the two tables are different...0
-
It will work when tables are different but on one condition that data types must match.
From the documentation:
The FromFields and ToFields must be of the same data type, but they do not have to belong to the same table.0 -
Table1.setrange(name, "peu*");
IF Table1.FINDSET THEN REPEAT
Table2.setrange(name,Table1.name)
IF Table2.FINDSET THEN REPEAT
table2.mark(true);
UNTIL table2.next = 0;
UNTIL Table1.NEXT = 0;
Table2.MARKEDONLY(true);
-> Findset now delivers all the things you need now.
Assuming i understood your problem
there may be better options to solve this though.
For more info lookup the mark function on msdn
Austrian NAV/BC Dev0 -
Or you could do this
Table2.SETFILTER(Name,Table1,GETFILTER(Name));
IF Table2.FINDSET THEN ....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