Dynamic filter for report w/out using request form

Sapphire123
Member Posts: 112
Hi All:
I'm trying to set a dynamic filter for a report based on the record number (Customer No.) - I"ve put the following code in the ' Customer - PreDataItem" trigger'
Setfilter("No.", Rec."No.");
However, it doesn't compile because of the undeclared 'Rec' variable. How do I set a dynamic filter for report without using the Request Form?
Thanks in advance..
I'm trying to set a dynamic filter for a report based on the record number (Customer No.) - I"ve put the following code in the ' Customer - PreDataItem" trigger'
Setfilter("No.", Rec."No.");
However, it doesn't compile because of the undeclared 'Rec' variable. How do I set a dynamic filter for report without using the Request Form?
Thanks in advance..
0
Answers
-
Actually the usage should be Rec.SETFILTER(Rec."No.", whateverFilter)...
Think you got the parameters mixed upNAV - Norton Anti Virus
ERP Consultant (not just Navision) & Navision challenger0 -
you can use
Setfilter("No.", "No.");
but do not forget that the Dataitem record is not inicialized in PreDataItem if you didn't use C/AL to init it (Find, Get etc.)0 -
Kamil,
That's exactly what i'm trying to do..
however, how do I intialize a record on predataitem trigger?..
when I try the following code, it only picks up the first record and not the customer record (form) i'm on when I try to run the report.
*** Customer - OnPreDataItem() ****
Customer.GET("No.");
SETFILTER("No.", "No.");
********************************
The above doesn't work because it still doesn't intialized the record. I've tried putting this in the *** Customer - OnAfterGetRecord *** trigger also, but it keeps getting me the first record in the table. How do I initalize so that I filter on the current customer number? :roll:
Thanks in advance.. !0 -
ok, i'm not sure if this is the right way to solve this problem... but, its working for now
I used a single instance codeunit to share the selected record number - and to used this to set the filter for the report.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