Options

Task Scheduler: How to pass parameters to OnRun Codeunit

HarakiriHarakiri Member Posts: 8
Hello there,
the TaskScheduler.Createtask Function has the optional parameter of RecordId. How can I "access" the value of the specified RecordId when the task is executed?
Is there some kind of parameter that's getting passed to the OnRun Trigger of the Codeunit that gets executed?
There's almost zero documentation to the Task Scheduler from Microsoft (besides the obvious description of the functions).

For RecordId Microsoft states:
RecordID
Specifies the recordID of the record that you want to run the task on.

Perfect! But besides specifying that Recordid - how do I get access to it when the task is executed.
https://docs.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/methods-auto/taskscheduler/taskscheduler-createtask-method

Thanks a lot in advance!

Best Answer

  • Options
    HarakiriHarakiri Member Posts: 8
    Answer ✓
    Got it, define "TableNo = YOURTABLE" in the Codeunit.

Answers

  • Options
    HarakiriHarakiri Member Posts: 8
    Answer ✓
    Got it, define "TableNo = YOURTABLE" in the Codeunit.
Sign In or Register to comment.