SHOW operator
The SHOW operator creates an action that opens a form in interactive view.
Syntax
SHOW [formId =] target
[formActionOptions]
[{initActionOperator}]
Where target is one of two forms — the named-form opens a previously declared form:
formName [OBJECTS objName1 = expr1 [NULL], ..., objNameN = exprN [NULL]]
and the class-form opens the list or edit form of a class:
classFormType className = expr [NULL]
And formActionOptions is any combination of the following options, in any order:
FILTERS filterExpr1, ..., filterExprM
syncType
windowType
manageSessionType
sessionScopeType
cancelType
READONLY
CHECK
ACTIVATE [USER]
Where windowType is one of:
FLOAT
WINDOW [windowName]
EMBEDDED
POPUP
IN containerName
Description
The SHOW operator creates an action that opens the specified form. The OBJECTS block sets initial values for the form's objects (in the class-form, the single = expr plays the same role for the form's only object, which is implicitly named object and can be referenced by that name inside FILTERS expressions). Inside formActionOptions, the FILTERS clause attaches additional filters computed from the calling context; the remaining options control the form-opening behavior — flow, layout, session, system-action visibility, and other modifiers. The trailing block {initActionOperator} runs once when the form is opened.
Parameters
-
formIdString literal - the label the opened form carries, by which later actions address it:
ACTIVATE FORMandCLOSE FORM. Several open forms may carry the same label:CLOSE FORMrequests that each of them close, whileACTIVATE FORMactivates the first one it finds in theFORMSwindows. By default, the opened form carries none. -
formNameForm name. Composite ID.
-
classFormTypeType of the class form to open. It is specified by one of the keywords:
LIST— the selection (list) formEDIT— the editing form
-
classNameName of the custom class whose list or edit form is opened. Composite ID.
-
objName1, ..., objNameNNames of form objects for which initial values are specified. Simple IDs.
-
expr,expr1, ..., exprNExpressions whose values are used as the initial values of the corresponding form objects.
-
NULLafter the initial valueKeyword. Allows the passed initial value to be
NULL. By default, if any passed value isNULL, the action is skipped and control passes to the next action. A passedNULLdoes not become the object's value: it is the same as passing no value, and the group's default object becomes current. -
initActionOperatorContext-dependent action operator that runs on form opening, after the form's
EVENTS ON INIThandlers.
Options
-
filterExpr1, ..., filterExprMNon-empty list of expressions that define additional filters applied to the form. Each expression can use both the calling context parameters and the form's own objects.
-
syncTypeThe flow-control mode. One of:
WAIT— synchronous (wait for the form to close)NOWAIT— asynchronous (continue immediately after opening)
By default, the platform picks
WAITwhen the call is itself made from a modal form, when more session usages will follow in the same call, or when the chosen window-type is itself modal (FLOAT,EMBEDDED,POPUP); otherwiseNOWAIT. -
windowTypeThe form layout:
FLOATshows the form as a floating window,WINDOWas a tab in the system forms windowSystem.forms- or in theFORMSwindowwindowNamenames, which is how a form is drawn as a header or a side panel -EMBEDDEDandPOPUPas in-place editors, andINplaces the form insidecontainerName— a form-qualified design component (the form's name followed by the component's path within that form's design) that must be a container. By default,FLOATis used in synchronous mode andWINDOWin asynchronous mode. In synchronous mode aWINDOWtab blocks the form it is opened from until it is closed, and from a form shown as a window it is shown as a window, likeFLOAT: to open a tab from a form shown as a window, specifyNOWAIT.-
windowNameName of the window the form is docked into. Composite ID of a window declared with
WINDOW ... FORMS; any other window is an error. The mobile web client and the desktop client drawSystem.formsalone, so there the form opens inSystem.forms, as a tab.
-
-
manageSessionTypeOverrides whether the opened form is the session owner. One of:
MANAGESESSION— force ownershipNOMANAGESESSION— force non-ownership
By default, the form is the session owner only if the session has no other owner at opening time.
-
sessionScopeTypeThe session in which the form is opened. One of:
NEWSESSION— a new top-level sessionNESTEDSESSION— a new nested sessionTHISSESSION— the current session (default)
-
cancelTypeOverrides whether the Cancel system action (
System.formCancel[]) is shown on the form. One of:CANCEL— force visibleNOCANCEL— force hidden
By default, it is shown if the form is the session owner and the form contains actions that can change the session.
-
READONLYKeyword. If specified, the form is opened in read-only mode.
-
CHECKKeyword. If specified, when the user presses the OK system action (
System.formOk[]), the platform first validates the pending session changes (runs the apply pass — constraints, aggregations, event handlers — without committing); the form closes only if the validation passes, otherwise it stays open. -
ACTIVATEKeyword. If specified, and the same form is already open in the window with the same
formId, that form is activated instead and no second one is shown; the form that is already open is shown as it is. An open withoutformIdmeans the form opened without one, not any of them. Since the form already open is shown unchanged,ACTIVATEcan be specified only together withWINDOWandNOWAIT, and not together withOBJECTS,FILTERS,READONLY,CHECK, a session option, a cancel option or an initialization block — those apply to a form being opened and would have nowhere to go.When the client predicts this opening and finds the form already open, it activates that form immediately and sends the action to the server. If the action reaches a matching
SHOW, the server skips creating the form, so its initialization events and close events do not run. Other statements and action event handlers execute as usual.This early activation happens for an action started from the navigator - by a click or by a key binding - for the action a property runs on its ordinary change or binding, unless the change supplies a value, and, in the web client, for a form event. It does not happen for a value a custom view supplies (a
CUSTOMrenderer's change, the React controller'schangeProperty), for a paste, or for an action a custom view runs by name: there the form is created on the server and closed by the client when it arrives, as described below.Reuse is decided when the action is invoked. If the form closes afterwards, this opening does not recreate it. The activation is retained even if the action is rejected or does not reach this
SHOW.Without an early activation, the client checks again when the new form arrives. If a matching form is already open then, the client activates it and closes the new one; in this case the new form's initialization and close events run.
Adding
USERleaves the choice to the user: the form is activated only while duplicate forms are forbidden for them (theforbidDuplicateFormssetting), and holding Ctrl when invoking an action from the navigator opens another instance anyway. WithoutUSERneither the setting nor Ctrl changes it.USERis what a navigator form element does.
Examples
date = DATA DATE (Order);
FORM showForm
OBJECTS dateFrom = DATE, dateTo = DATE PANEL
PROPERTIES VALUE(dateFrom), VALUE(dateTo)
OBJECTS o = Order
FILTERS date(o) >= dateFrom, date(o) <= dateTo
;
testShow () {
// initial values for two objects, init action after opening
SHOW showForm OBJECTS dateFrom = 2010_01_01, dateTo = 2010_12_31 { MESSAGE 'On init'; };
// open in a new session as a floating window, with the new object as the current one
NEWSESSION {
NEW s = Sku {
SHOW sku OBJECTS s = s FLOAT;
}
}
// open the named form with panel values, an additional filter, and an instance identifier
SHOW 'recentOrders' = showForm OBJECTS dateFrom = 2024_01_01, dateTo = 2024_12_31 FILTERS number(o) > 1000 NOWAIT;
// open the list form of the Sku class, focused on a specific sku
NEW s = Sku { SHOW LIST Sku = s; }
}