Skip to main content
Version: Next

FORM SET OUTPUT

FORM SET OUTPUT ( {aTable ;} form {; userForm} )

ParameterTypeDescription
aTableTableTable for which to set the output form, or Default table, if omitted
formText, ObjectName (string) of table form, or a POSIX path (string) to a .json file describing the form, oran object describing the form
userFormTextName of user form to use

This command is not thread-safe, it cannot be used in preemptive code.

Description

The FORM SET OUTPUT command sets the current output form for table to form, or userForm. The form must belong to aTable.

The form parameter is the form which will be displayed. Pass the:

  • the name of a form;
  • the path (in POSIX syntax) to a valid .json file containing a description of the form to use. See Form file path;
  • an object containing a description of the form.

The scope of this command is the current process. Each table has its own output form in each process.

Note: For structural reasons, this command is not compatible with project forms.

FORM SET OUTPUT does not display the form; it just designates which form is printed, displayed, or used by another command. For information about creating forms, see the 4D Design Reference manual.

The default output form is defined in the Explorer window for each table. This default output form is used if the FORM SET OUTPUT command is not used to specify an output form, or if you specify a form that does not exist.

The optional userForm parameter lets you specify a user form (coming from form) as the default output form. If you pass a valid user form name, this form will be used by default instead of the output form in the current process. This allows you to have several different custom user forms simultaneously (generated using the _o_CREATE USER FORM command) and to use the one that suits according to the context.

For more information about user forms, refer to the Overview of user forms section.

Output forms are used by three groups of commands. One group displays a list of records on screen, another group generates reports, and the third group exports data. The DISPLAY SELECTION and MODIFY SELECTION commands display a list of records using an output form. You use the output form when creating reports with the PRINT LABEL and PRINT SELECTION commands. Each of the export commands (EXPORT DIF, EXPORT SYLK and EXPORT TEXT) also uses the output form.

Example 1

The following example shows a typical use of FORM SET OUTPUT. Note that although the FORM SET OUTPUT command appears immediately before the output form is used, this is not required. In fact, the command may be executed in a completely different method, as long as it is executed prior to this method:

 FORM SET INPUT([Parts];"Parts In") //Select the input form
 FORM SET OUTPUT([Parts];"Parts List") //Select the output form
 MODIFY SELECTION([Parts]) //This command uses both forms

Example 2

The following example uses the path to a .json form to print the records in an employee list:

 FORM SET OUTPUT([Personnel];"/RESOURCES/PersonnelPrintForm.json")
 ALL RECORDS([Personnel])
 PRINT SELECTION([Personnel])

See also

_o_CREATE USER FORM
DISPLAY SELECTION
EXPORT DIF
EXPORT SYLK
EXPORT TEXT
FORM SET INPUT
MODIFY SELECTION
PRINT LABEL
PRINT SELECTION