OnRun (Codeunit) Trigger
Version: Available or changed with runtime version 1.0.
Runs when a codeunit is run.
Syntax
trigger OnRun()
begin
...
end;
Example
The OnRun()
trigger is used to initialize the codeunit. A codeunit can be called from another codeunit, a page, or a report. The OnRun()
trigger is run when the codeunit is called. The following pseudo code illustrates how the OnRun()
trigger is run when a codeunit is called from a page.
page 50111 MyPage
{
trigger OnOpenPage();
begin
Codeunit.Run(Codeunit::RunMyCode);
end;
}
codeunit 50110 RunMyCode
{
trigger OnRun()
begin
// Run some code here
end;
}
See Also
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for