Form Triggers

Microsoft Dynamics Nav 2009

The following triggers apply to forms in C/SIDE.

C/SIDE Form Triggers

The following table lists the form triggers and when they are executed.

Form trigger name Executed

OnInit Trigger

The form is loaded, but before the controls are available.

OnOpenForm Trigger

The form is initialized (the controls are available).

OnQueryCloseForm Trigger

The form is about to close, but before OnCloseForm Trigger. If this trigger returns false, the form is not closed. The intended use is to ask the user if they really want to close the form.

OnCloseForm Trigger

The form is about to close, and after OnQueryCloseForm Trigger.

OnActivateForm Trigger

The form is activated, that is, when the form becomes the active window.

OnDeactivateForm Trigger

The form is no longer the active window.

OnFindRecord Trigger

The form is opened and a record is retrieved and also when the user chooses to go to the first or the last record.

OnNextRecord Trigger

The system determines how to select the next record, for example after a user presses PAGE DOWN (in a card form).

OnAfterGetRecord Trigger

A record has been retrieved but not yet displayed.

OnAfterGetCurrRecord Trigger

The current record is retrieved. In a table box, OnAfterGetRecord Trigger is called for all the records displayed, while this trigger is called for the current record.

OnBeforePutRecord Trigger

A record is about to be saved.

OnNewRecord Trigger

A new record has been initialized but not yet displayed.

OnInsertRecord Trigger

A new record is about to be inserted in the table.

OnModifyRecord Trigger

A record is about to be modified in the table.

OnDeleteRecord Trigger

A record is about to be deleted from the table.

OnTimer Trigger

After the OnOpenForm Trigger and after the time specified in the TimeInterval property of the form has elapsed.

OnCreateHyperlink Trigger

You create a URL to a form so that you can send it by e-mail or paste it on your desktop.

OnHyperlink Trigger

You click a hyperlink and after the OnInit Trigger is executed.

The preceding table only shows the main function of each trigger.


OnInsertRecord Trigger, OnModifyRecord Trigger, and OnDeleteRecord Trigger, correspond to triggers at the table level. If you use triggers at both the form and table level, the triggers at the form level are executed first.

See Also