Calculation Model

According to Forms API 2.x model, form calculations are performed as follows:

The Global MetaScript is executed only once, when the form is loaded. Form events are fired after each user action. It is possible to add listeners for these events; an event listener is a particular function that executes each time a specific type of event is fired by the system. Any number of listeners may be created for a given event type and one function may be a listener for several distinct events. The order in which event listeners are executed is not guaranteed.

To support this event listener calculation model, Virtual Ticket defines the Form global object, which represents the form in which the MetaScript is being executed.

To add an event listener, use Form.addEventListener( eventType, listenerFunction ). The listenerFunction may have at most one parameter (the parameter corresponding to the event object that lead the listener to be executed).

For example:

If the above code is added into the Global MetaScript for a form, an alert will appear if the Job Name field is changed when a Job is edited using that form.

See Event Types and Event Sequences topics for the complete list of form events and their sequences.

Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.