Get ID after using codeunit.run

_Midnight_
Member Posts: 15
Hi guys!
Is it possible to call a codeunit with codeunit.run and then get the ID of the calling object, in the "OnRun" section?
I know there is a recordRef, but is there a objectref?
thanks!
Is it possible to call a codeunit with codeunit.run and then get the ID of the calling object, in the "OnRun" section?
I know there is a recordRef, but is there a objectref?
thanks!
0
Answers
-
I'd consider doing it a different way. Setting your value in a function, then calling Codeunit.Run.
Codeunit.SetCallingObject(objectID);
Codeunit.RUN;
Where Codeunit is a variable that refers to your Codeunit, not the CODEUNIT system variable.0 -
thanks, but that's the way I did before.
Thing is, we have to customize a lot of reports due implementation of a new software.
The idea was, reducing customization by adding just one "codeunit.run"-line to each report.
Looks like this will not work as we have to make var declaration and other steps.
So, thanks anyway.0 -
Based on blog of NAV team for logging report usage through the 1 CU, special trigger 120 (see http://blogs.msdn.com/b/nav/archive/2011/06/23/how-to-log-report-usage.aspx), I suggest you to modify that trigger and to call your codeunit, sending the report number (you've got ReportID as a variable in OnReportRun trigger in 1st CU).
Hope you've got my idea!Sincerely yours, GRIZZLY
Follow my blog at http://x-dynamics.blogspot.com0 -
thanks grizzly!
seems to be a good approach and I will give it a try!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