Copy filter of data item to a global record variable

tortmann
Member Posts: 3
Hey there,
does anybody know a possibility to copy the filter of an intended data item to a global record variable in the OnPreReport Trigger? The GETFILTERS is not very helpful, I think, because it doesn't return a "real" filter string. A possibility is to use the getfilter, but then i have to hard code the field names and i want to code a function, that i can use in any report for any data item.
Any Ideas?
Thanx in advance
tobias
does anybody know a possibility to copy the filter of an intended data item to a global record variable in the OnPreReport Trigger? The GETFILTERS is not very helpful, I think, because it doesn't return a "real" filter string. A possibility is to use the getfilter, but then i have to hard code the field names and i want to code a function, that i can use in any report for any data item.
Any Ideas?
Thanx in advance
tobias
0
Comments
-
COPYFILTERS
Sorry for the spam :-)0 -
or COPY.
"Use this function to copy a record from a C/SIDE table. All filters, marks, and keys are included in the copy.""Real programmers don't comment their code.
If it was hard to write, it should be hard to understand."0 -
I have had a similar problem.
I wanted the user not to bother with too much input tabs.
I added a dummy table as first table where the filters can be set by the customer.
The first statement in OnAfterGetRecord is CurrReport.break as it is only used to get the filters.
In the OnPreDataItem of each further table I used copyfilters or did it with setfilter/getfilter.prefilter (table "G/L Account") "Dimension Value" (no indent) --> "G/L Account" (indented to "Dimension Value") ----- "Dimension Value"-OnPreDataItem "Dimension Value".SETFILTER("Dimension Value".Code,prefilter.GETFILTER(prefilter."Global Dimension 1 Filter")); "G/L Account" OnPreDataItem "G/L Account".COPYFILTERS(prefilter); "G/L Account".SETFILTER("Global Dimension 1 Filter","Dimension Value".GETFILTER("Dimension Value".Code));
0 -
Thanks Christian Buehl, this is exactly what I needed! Works perfectly!
Dneal0
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