Export (0) Print
Expand All

RUNMODAL Function (Form)

Microsoft Dynamics Nav 2009

Creates, runs, and closes a form object that you specify. When a form is run modally, no input (keyboard or mouse click) can occur except to objects on the modal form. If, at design time, you know the specific form that you want to run, use this function or the RUN Function (Form). If you do not know the specific form that you want to run, you can use the FORM.RUNMODAL Function (Form) or the FORM.RUN Function (Form).


[Action :=] Form.RUNMODAL

Parameters

Form

Type: Variable

After you define this variable, you can run the following form functions:

  • SETTABLEVIEW

  • SETRECORD

  • GETRECORD

  • RUN

  • RUNMODAL

Unlike the Form.RUN function, the variable is not automatically cleared after this function runs.

If the form you specify does not exist, a compilation error occurs.

Type: Code

Specifies what action the user took. The return value is optional. The following table shows the possible return values.

Return value Description

OK

The user selected OK to exit the window

Cancel

The user selected Cancel to exit the window

LookupOK

The user selected OK on a lookup window

LookupCancel

The user selected Cancel on a lookup window

Yes

The user selected Yes

No

The user selected No

Close

The user selected Close, ESC, or closed the window using the title bar

FormHelp

The user selected Help

RunObject

The user selected an option that ran another object

RunSystem

The user selected an option that ran an external program

After you define the variable Form1, you can use it before and after you run the form. If you use the Form.RUN function, you can only use the variable before you run the form.

This example shows how to use the RUNMODAL function. Assume that the variable Form1 has been defined as Form 1.

CLEAR(Form1);
Form1.XXX; // any user-defined function
Form1.SETTABLEVIEW(MyRecord);
Form1.SETRECORD(MyRecord);
IF Form1.RUNMODAL = Action::LookupOK THEN Form1.GETRECORD(MyRecord)...

This code example includes the CLEAR Function to verify that the variable has been cleared.

Community Additions

ADD
Show:
© 2014 Microsoft