Skip to main content
Version: 6.x

FORM statement

The FORM statement creates a form.

Syntax

FORM name [caption] formOptions
formBlock1
...
formBlockN
;

After specifying the form name and caption, form options formOptions are specified in an arbitrary order

imageSetting
LOCALASYNC

After the form options, the blocks of the form formBlock1 ... formBlockN are described in the arbitrary order:

OBJECTS ... 
TREE ...
PROPERTIES ...
FILTERS ...
[EXTEND] FILTERGROUP ...
USERFILTERS ...
ORDERS ...
EVENTS ...
REPORT propertyExpression
FORMEXTID extID
EDIT className OBJECT objectName
LIST className OBJECT objectName

Description

The FORM statement declares a new form and adds it to the current module. In addition, this statement is used to describe the form structure, as well as its static and partially interactive (except form design) views. At the beginning of the statement, name and captions are specified, followed by form options and the declaration containing an arbitrary number of blocks describing the structure of the form. They can be used in any order, provided that each block is declared after the blocks whose elements it uses. Each block can be used any number of times.

Parameters

  • name

    Form name. Simple ID. The name must be unique within the current namespace.

  • caption

    Form caption. String literal. If the caption is not defined, the form's name will be its caption.

Form options (formOptions)

  • imageSetting

    Configuring the display of the form's icon. By default, the presence or absence of an icon is controlled by the parameters settings.defaultImagePathRankingThreshold and settings.defaultAutoImageRankingThreshold. This option allows you to manually configure the icon display. It can have one of two forms:

    • IMAGE [fileExpr]

      Specifying the relative path to the image file that will be displayed as the form's icon. If fileExpr is not specified, the default icon display mode is activated.

      • fileExpr

        Expression whose value specifies the path to the image file. The path is specified relative to the images directory.

    • NOIMAGE

      Keyword indicating that the form should have no icon.

  • LOCALASYNC

    Keyword indicating that local events handling will be performed after changes are displayed on the form.

Form blocks (formBlock1 ... formBlockN)

Examples

CLASS Document;

// declaring the Documents form
FORM documents 'Documents'
// Adding one object of the Document class. The object will be available by this name
// in the DESIGN, SHOW, EXPORT, DIALOG, etc. operators.
OBJECTS d = Document


// ... adding properties and filters to the form

// marking that this form should be used when it is necessary to select a document,
// while the d object should be used as a return value
LIST Document OBJECT d
;

CLASS Item;

// declaring the Product form
FORM item 'Product'
// adding an object of the Item class and marking that it should be displayed
// in the panel (i.e., only one value is visible)
OBJECTS i = Item PANEL

// ... adding properties and filters to the form

// marking that this form should be used when it is necessary to add or edit a product
EDIT Item OBJECT i
;

// declaring a form with a list of Products
FORM items 'Products'
OBJECTS i = Item

// ... adding properties and filters to the form

// adding buttons that will create and edit the product using the item form
PROPERTIES(i) NEWSESSION NEW, EDIT
;

CLASS Invoice;
CLASS InvoiceDetail;

// declaring the invoice print form
FORM printInvoice
OBJECTS i = Invoice // adding an object of the invoice class for which printing will be executed

// ... adding properties and filters to the form
;

// splitting the form definition into two statements (the second statement can be transferred to another module)
EXTEND FORM printInvoice
// adding invoice lines, each of which will be used in the report as a detail
OBJECTS d = InvoiceDetail

// ... adding properties and filters to the form
;
// declaring an action that will open the invoice print form
print (Invoice invoice) { PRINT printInvoice OBJECTS i = invoice; }