Options

passing a record reference to a codeunit

titus71titus71 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!

Comments

  • Options
    tinoruijstinoruijs Member Posts: 1,226
    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 specialist
  • Options
    titus71titus71 Member Posts: 6
    Solved,
    The receiving Function receives a record parameter from the calling line in the OnAfterGetRecord trigger.

    Thanks!
  • Options
    tinoruijstinoruijs Member Posts: 1,226
    Yes, that's it.

    Tino Ruijs
    Microsoft Dynamics NAV specialist
Sign In or Register to comment.