Filters

amitagupta
Member Posts: 43
Hi All...
Here are the set of questions:
1) If I apply SETRANGE on a field and then again apply SETRANGE for some other value on the same field, what would happen?
2) If I apply SETRANGE on a field and then apply SETFILTER for some other value on the same field, what would happen?
3) If I apply SETFILTER on a field and thena apply SETFILTER for some other value on the same field, what would happen?
4) If I apply SETRANGE on a field and then apply SETRANGE on some other field of the same record set, what would happen?
Thanks.. Have a nice day!
Amita
Here are the set of questions:
1) If I apply SETRANGE on a field and then again apply SETRANGE for some other value on the same field, what would happen?
2) If I apply SETRANGE on a field and then apply SETFILTER for some other value on the same field, what would happen?
3) If I apply SETFILTER on a field and thena apply SETFILTER for some other value on the same field, what would happen?
4) If I apply SETRANGE on a field and then apply SETRANGE on some other field of the same record set, what would happen?
Thanks.. Have a nice day!
Amita
0
Comments
-
[Topic moved from Navision forum to Navision Exams & Certification forum]Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0 -
Why no reply...???0
-
Hi,
I think that if You apply 2 filters on the same field, the second one will override the first one.0 -
edited........................-Dhan Raj Bansal
Linkedin Profile: http://in.linkedin.com/in/dhanrajbansal0 -
Koshe wrote:Hi,
I think that if You apply 2 filters on the same field, the second one will override the first one.
1)When you apply 2 filters on the same field (no matter if you use SETRANGE or SETFILTER), the second one will override the first one.
So if you use code like this (for table 17)SETRANGE("Entry No.",10000,20000); SETRANGE("Entry No.",12000,25000);
the result will be 12 000.. 25 000 (the last filter used on that field)
You can try it by usingMESSAGE('%1',GETFILTERS);
after setting that filters.
2) and 3) is same as the 1), you are just using different statements for setting filters
4)For this case you will get an intersection of filters (like DRB wrote)Better to be critical then self-critical0 -
abartonicek wrote:4)For this case you will get an intersection of filters (like DRB wrote)
Could not understand... :-k0 -
I see DRB has edited his post so I'll write it again.
If you set filters on two different fields in record set (let say, table 17), as a result, you will get an intersection of those two filters.
Or more clearly:
If you use code like this:SETRANGE("Entry No.",10000,20000);
then the result are all the entries with number from 10000 to 20000
If you have code like this:SETRANGE("Entry No.",10000,20000); SETRANGE("Posting Date",01012006D,01012007D);
then the result are all the entries with number from 10000 to 20000 where Posting Date is in last year (01.01.2006-01.01.2007).
With first filter you are selecting entries based on their Entry No. and with that other filter you are selecting some entries from allready selected range (10000..20000).
It's like having two fields: Char and Num and table looks like this
Char Num
A 1
A 2
A 3
A 4
B 1
B 2
B 3
B 4
C 1
C 2
C 3
C 4
AfterSETRANGE(Char,B);
result is:
Char Num
B 1
B 2
B 3
B 4
and result afterSETRANGE(Char,B); SETRANGE(Num,1,2);
is:
Char Num
B 1
B 2
Hope it is a little bit more clear now.Better to be critical then self-critical0 -
Great explanation abartonicek.... =D>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