SETRANGE over SETFILTER

mickuk
Member Posts: 47
Hi All,
Is there any main benefit of using Record.SETRANGE(Field [,FromValue] [.ToValue]) over Record.SETFILTER(Field, String, [Value],...)? Would one be correct to assume that SETRANGE() limits your result set to the requested range....for example:
say you have the following records
Entry No. Name
1 Big Bill
2 Roger Hill
3 Badger Pill
4 Nigel Will
If you said SETRANGE("Entry No.", '1', '3') would the effects be a record set that is shown below?
Entry No. Name
1 Big Bill
2 Roger Hill
3 Badger Pill
I presume that the SETFILTER option just applies a filter thus sorting the records that you would have returned from running the function? Probably something that has been mentioned before, however my searches have not been very productive. I have read what is detailed in the "Navision Financials Help" and the functions are described to be very similar. Some clarification as to which is the most productive would be appreciated.
Thanks in advance!
Is there any main benefit of using Record.SETRANGE(Field [,FromValue] [.ToValue]) over Record.SETFILTER(Field, String, [Value],...)? Would one be correct to assume that SETRANGE() limits your result set to the requested range....for example:
say you have the following records
Entry No. Name
1 Big Bill
2 Roger Hill
3 Badger Pill
4 Nigel Will
If you said SETRANGE("Entry No.", '1', '3') would the effects be a record set that is shown below?
Entry No. Name
1 Big Bill
2 Roger Hill
3 Badger Pill
I presume that the SETFILTER option just applies a filter thus sorting the records that you would have returned from running the function? Probably something that has been mentioned before, however my searches have not been very productive. I have read what is detailed in the "Navision Financials Help" and the functions are described to be very similar. Some clarification as to which is the most productive would be appreciated.
Thanks in advance!
0
Comments
-
Hi,
SETRANGE can be used for simple filters, for example:Cust.SETRAGE("No.",'5000');
- only one number;Cust.SETRAGE("No.",'5000'..'6000');
- all numbers from 5000 to 6000.
SETFILTER is used for more complex filters like:Cust.SETFILTER("No.",'%1|%2','5000','6000');
- number 5000 or number 6000;Cust.SETFILTER("No.",'<>%1&<%2','5000','6000');
- all numbers less than 6000, except 5000.Virginijus0 -
-
Wolfikas wrote:
Cust.SETRAGE("No.",'5000'..'6000');
- all numbers from 5000 to 6000.
This should beCust.SETRANGE("No.",'5000','6000');
Rule of thumb is to allways use SETRANGE, Unless you need to write complex filters.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