how to do a double filter

haritza10
Member Posts: 28
Hi everybody, i have a problem and i don't know how to resolve it.
I want to do this :
RECORD.SETFILTER(FIELD1,FIELD2,'=%1|=%2',VALUE1, VALUe2);
This code is impossible to do in Navision but nobody knows how can i do this code in different way.
Thanks a lot.
I want to do this :
RECORD.SETFILTER(FIELD1,FIELD2,'=%1|=%2',VALUE1, VALUe2);
This code is impossible to do in Navision but nobody knows how can i do this code in different way.
Thanks a lot.

0
Comments
-
hi,
in navision you would do it using the option to mark records.
- mark the necessary records (ctrl-f1)
- if all records are marked, select view--> marked only
if you check the help, you will find that these steps can also be performed using funtions (mark(), markedonly())
Hope this helps0 -
Hey, thats crazy what you try to do :oops:
Do it this way:
If you want to select a simple range use the setrange command
rec.setrange(field,fromvalue,tovalue);
If you want to select some values do it like in the graphic interface
filterstring := 'value1|value2';
// Alternative: filterstring := strsubstno('%1|%2',value1,value2);
rec.setfilter(field, filterstring);
If you want to filter different fields the use the method above on each field
rec.reset;
rec.setfilter(field1,filterstring1);
rec.setfilter(field2,filterstring2);
Dont forget to reset all filters with rec.reset before you set the intended filters. Otherwise you can receive unexpected results from filtersettings you have done before.0 -
I want to do a filter with two fields. I want to filter a record by one field OR another field. This is my problem --> ONE FIELD "OR" ANOTHER FIELD NOT ONE FIELD "AND" ANOTHER FIELD.0
-
This issue is a little bit tricky but in Navision its possible doe do with some code:
You need an independend filter criteria which can be done by marking the records. Another possibility is to work with temporary tables.
So how to do:rec.reset; rec.setfilter(field1,filterstring1); if rec.find('-') then repeat rec.mark(true); // Mark all selected records until rec.next = 0; rec.setrange(field1); // clear previous filter rec.setfilter(field2,filterstring2); // Now the records with the second criteria if rec.find('-') then repeat rec.mark(true); // Mark all selected records until rec.next = 0; rec.setrange(field2); // clear previous filter rec.markedonly(true); // Now select all marked // From now on you have only the selected records
0 -
thank you, this is that i want.
Thanks a lot Christian.0 -
that's what I ment in my previous post0
-
This Code Help in my Developement
Thank you Very Much Christian....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