Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

RUN Function (Codeunit)

Microsoft Dynamics Nav 2009

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.


[Ok :=] Codeunit.RUN(VAR Record)

Parameters

Codeunit

Type: Codeunit

Identifies the unit of code you want to run.

VAR Record

Type: 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.

Type: Boolean

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.

VARc : CodeUnit1,c.XXX(expression1, ...); // any user-defined function c.RUN(Rec)
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.