Filter problem

kenl
Member Posts: 182
Hello,
I have a case like this:
I have a field to store location code filter. (The value may be 'w1..w5' , 'w1|w5..w10' or any valid field filter)
Now given a location code (eg. w2), I would like to know, whether the location is match within the location code filter.
How can I do it? Any suggestion?
Thanks.
I have a case like this:
I have a field to store location code filter. (The value may be 'w1..w5' , 'w1|w5..w10' or any valid field filter)
Now given a location code (eg. w2), I would like to know, whether the location is match within the location code filter.
How can I do it? Any suggestion?
Thanks.
0
Comments
-
Hi,
First thing I Think of:Create Temporary Location Table Location.Setrange(Code, LocationFilter); If Find('-') then repeat CopyToTempTable Until next = 0; if templocation.get(w2) then IsInFilter;
Maybe to complex? I think it should work0 -
take Location table as temporary table, clear it, insert your value, apply filter, if result is empty, it is not within, if you get one record, it is within...0
-
Also Possible (2nd Tought)
locationisinfilter := FALSE; Location.Setrange(Code, LocationFilter); If Find('-') then repeat if location.code = 'W2' then locationisinfilter := TRUE; Until (next = 0) or locationisinfilter;
Know you have 3 options0 -
3rd option:
Location.SetFilter(Code, LocationFilter); Location.FILTERGROUP(1); Location.Setrange(Code,'W2'); Location.FILTERGROUP(0); if Location.ISEMPTY then //Is not within else //Is within
It will do this filtering: LocationFilter AND 'W2'0 -
Hello all,
Thanks for all of your suggestion.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