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
andsettings.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
)
-
OBJECTS ...
Adds objects to the form. Object block syntax .
-
TREE ...
Adds an object tree to the form. Syntax of the object tree block.
-
PROPERTIES ...
Adds properties and actions to the form. Syntax of the property and action block.
-
FILTERS ...
Adds fixed filters to the form. Syntax of the fixed filters block.
-
[EXTEND] FILTERGROUP ...
Adds a group of filters to the form or extends an existing one. Syntax of a filter group block.
-
USERFILTERS ...
Adds user-defined filters to a form. Syntax of the user filters block.
-
ORDER ...
Adds sorting options to the form. Syntax of the order block.
-
PIVOT ...
Defines the initial settings for the pivot table view type. Syntax of the pivot block.
-
EVENTS ...
Defines actions that are executed on specific events. Syntax of the event block.
-
FORMEXTID extID
Specifying the name to be used to export/import this form. Used only in the structured view.
-
extId
String literal.
-
-
REPORT propertyExpression
Specifying the property whose value will be used as the name of the report file for an empty group. You can use the names of already declared objects on the form as parameters. It is assumed that the values of these objects will be passed when the form is opened in the print view (if it doesn't happen, they will be considered equal to
NULL
).-
propertyExpression
-
-
EDIT сlassName OBJECT objectName
Sets the current form as the edit form for all objects of the specified class.
-
className
The name of the custom . When editing objects of this class, the created form will be opened. Defined with a composite ID.
-
objectName
The name of the form object that will be used for editing. Defined with a simple ID.
-
-
LIST сlassName OBJECT objectName
Sets the current form as the list form for the object of the specified class.
-
className
The name of the custom class whose objects will be listed using the created form. Defined with a composite ID.
-
objectName
The name of the form object whose current value will be used as the object being selected. Defined with a simple ID.
-
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; }