RUN Function (Codeunit)
Loads and executes the unit of C/AL code you specify. To use this function, you can specify a C/SIDE table associated with the codeunit when you defined the codeunit properties. This allows you to pass a variable with the function. The transaction that the codeunit contains is always committed due to the Boolean return value.
Identifies the unit of code you want to run.
- VAR Record
This parameter is not always optional. If you specify a C/SIDE table associated with the codeunit, you can select a record. If you do not specify a table, you cannot specify a record. However, you must use this parameter to select a record if you attached a record to the codeunit when you defined its properties.
This parameter is a record data type.
If you do not include the optional return value and an error occurs while the codeunit is running, the C/AL code that called this codeunit will terminate.
If you include the return value and an error occurs, the calling C/AL code continues to run. This means that you must handle any errors. If you include the return value, the variables used in the codeunit will be cleared before and after the codeunit runs.
true if no errors occurred; otherwise, false.