Switch to: V9V8V7V6V5

Form Editor - Scripts

Scripts written in JavaScript language are extensively used in the forms to provide internal logic.

There are two kinds of scripts:

  • Slots - scripts intended to respond to certain events of the form or in the controls, they have a separate group in the properties of the object with slots:

  • User-defined methods of the form.

Form Object

To access the form object from within the script the keyword this is used, for example:

this.accept();

All controls of the form are accessible as the properties of the form:

name = this.cboName.currentText;

It is possible to define custom properties for the form objects, they are shared between the form scripts:

this.cboName.myProp = "prop1";

Import Forms

It is possible to execute one form from another, get data from it:

import '/UserDetails' as dlg;
if( dlg.exec() )
    this.cboUser.currentIndex = this.cboUser.ids.indexOf( dlg.getUserAddedId() );