How to apply large filter in "Location Filter" field in Item table

xplosive_fibonacci
Member Posts: 1
I have to create a report that calculates the calc field "Net change" for some items in the Item table. The "Net change" field is function of the "Location Filter" flow filter field, so if, for example, you do "Location Filter" := 17 for a given item, the "Net change" is calculated just for Location number 17.
My client wants that on the request form appears a checkbox that allows calculating the "Net change" for different categories of Locations (imagine that, for example, Locations 24 and 67 belongs to a category and 44,36,12 to another).
The problem here is that some categories contain so many Locations than the filter would be something like "1 | 3 | 45 | .... | 10456" and the string is too big that doesn't fit into a Text variable.
Somebody knows some tricky way to create filters better than just enumerate the codes of the Locations?
Thank you very much, all tips/suggestions are welcome!
My client wants that on the request form appears a checkbox that allows calculating the "Net change" for different categories of Locations (imagine that, for example, Locations 24 and 67 belongs to a category and 44,36,12 to another).
The problem here is that some categories contain so many Locations than the filter would be something like "1 | 3 | 45 | .... | 10456" and the string is too big that doesn't fit into a Text variable.
Somebody knows some tricky way to create filters better than just enumerate the codes of the Locations?
Thank you very much, all tips/suggestions are welcome!
0
Answers
-
How long is your text variable suposed to keep your filter expression? The maximum text lentght is 1024 characters so your selection filter must be really long if it does not fit in 1024 characters.
If you look into form 18 G/L Account List you will find there GetSelectionFilter function which is supposed to build nicely 'compressed' filter expression
For example, if you have in your system G/L Accounts numbered 10, 20, 25, 30, 40, 50, 55, 60, 65, 70, 75 and 80 and you do a lookup using form 18 and select accounts 20, 25, 30, 50, and all from 60 to 80, the GetSelectionFilter function is expected to return the filter expression in following form: 20..30|50|60..80 - rather than a simple list like this: 20|25|30|50|60|65|70|75|80
You could try and copy this function from form 18 to form 15 Location List (renaming it as there is already GetSelectionFilter function on it), and adapt it to work on Location table.
SlawekSlawek Guzek
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-031
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