multiple setfilter using MARK !!

pskannaa
Member Posts: 138
I need to use two different filter for getting record in LIST form
filter1 ->for matching Myfield1
filter2 -> for matching Myfield2
get the matching records from the both filters like OR operation in filter condition.
rec.setfilter("Myfield1",value);
IF Rec.FIND('-') THEN
REPEAT
Rec.MARK(TRUE);
UNTIL Rec.NEXT = 0;
rec.setfilter("Myfield2",value);
IF Rec.FIND('-') THEN
REPEAT
Rec.MARK(NOT Rec.MARK);
UNTIL Rec.NEXT = 0;
Rec.MARKEDONLY(TRUE);
Unable to get the proper records in the list, missing somewhere !!!!
Solution Plz..
Regards,
Psk
filter1 ->for matching Myfield1
filter2 -> for matching Myfield2
get the matching records from the both filters like OR operation in filter condition.
rec.setfilter("Myfield1",value);
IF Rec.FIND('-') THEN
REPEAT
Rec.MARK(TRUE);
UNTIL Rec.NEXT = 0;
rec.setfilter("Myfield2",value);
IF Rec.FIND('-') THEN
REPEAT
Rec.MARK(NOT Rec.MARK);
UNTIL Rec.NEXT = 0;
Rec.MARKEDONLY(TRUE);
Unable to get the proper records in the list, missing somewhere !!!!
Solution Plz..
Regards,
Psk
0
Comments
-
Before rec.setfilter("Myfield2",value);
do either rec.SETRANGE("Myfield1") or RESET to remove your first filter.0 -
added the code (Rec.SETRANGE(fld1)) after the first condition.....showing no record.
next added the code (Rec.SETRANGE(fld2);Rec.MARKEDONLY(TRUE)) after the second condition...showing only FIRST condition records, second one not taking the place...
What is wrong ???0 -
Sorry... Forget about the RESET command because it will clear your marks.
The idea to get the OR-like filter is something like:
rec.SETRANGE(field1,value);
IF rec.FIND('-') THEN REPEAT
rec.MARK(TRUE);
UNTIL rec.NEXT = 0;
rec.SETRANGE(field1);// <-- Removes the filter on field1
rec.SETRANGE(field2,value);
IF rec.FIND('-') THEN REPEAT
rec.MARK(TRUE); // <- Just a mark. If the record is marked it remains marked. If it isn't it gets marked.
UNTIL rec.NEXT = 0;
rec.MARKEDONLY(TRUE);0 -
Good....it's Working!!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