passing a record reference to a codeunit

titus71
Member Posts: 6
Hi everyone
I'm a noobie in Nav, I'm trying to use a codeunit from a report.
The codeunit needs to fill a blob field in the current record that the report is working with on the 'Sales Header' table.
The problem is (this may sound a little ignorant) that as I understand it, the codeunit has a limited scope and doesn't know what record the report is working with.
I need a way to pass a parameter to the function in the codeunit that makes it aware of the current record that the calling report is set to.
I have successfully filled-up the blob (for testing purposes) to the very last record in the table using SalesHeader.FINDLAST in the codeunit.
This command successfully points to the last record on the table and then the function goes on and fills-up the blob correctly.
My question is: How can I specify the actual record that I want to work with on the codeunit?
Thank you!
I'm a noobie in Nav, I'm trying to use a codeunit from a report.
The codeunit needs to fill a blob field in the current record that the report is working with on the 'Sales Header' table.
The problem is (this may sound a little ignorant) that as I understand it, the codeunit has a limited scope and doesn't know what record the report is working with.
I need a way to pass a parameter to the function in the codeunit that makes it aware of the current record that the calling report is set to.
I have successfully filled-up the blob (for testing purposes) to the very last record in the table using SalesHeader.FINDLAST in the codeunit.
This command successfully points to the last record on the table and then the function goes on and fills-up the blob correctly.
My question is: How can I specify the actual record that I want to work with on the codeunit?
Thank you!
0
Comments
-
Can you post the code you use now?
Could be al you need is to set Var to true on the record parameter you're using.
Tino Ruijs
Microsoft Dynamics NAV specialist0 -
Solved,
The receiving Function receives a record parameter from the calling line in the OnAfterGetRecord trigger.
Thanks!0 -
Yes, that's it.
Tino Ruijs
Microsoft Dynamics NAV specialist0
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