4D v16.3

FORM SET INPUT

Home

 
4D v16.3
FORM SET INPUT

FORM SET INPUT 


 

FORM SET INPUT ( {aTable ;} form {; userForm}{; *} ) 
Parameter Type   Description
aTable  Table in Table for which to set the input form, or Default table, if omitted
form  String in Name of the form to set as input form
userForm  String in Name of user form to use
in Automatic window size

The FORM SET INPUT command sets the current input form for aTable to form or userForm. The form must belong to aTable.

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

Note: For structural reasons, this command is not compatible with project forms. If you pass a project form in form, the command does nothing.

FORM SET INPUT does not display the form; it just designates which form is used for data entry, import, or operation by another command. For information about creating forms, see the 4D Design Reference manual.

The default input form is defined in the Explorer window for each table. This default input form is used if the FORM SET INPUT command is not used to specify an input 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 input form. If you pass a valid user form name, this form will be used by default instead of the input form in the current process. This allows you to have several different custom user forms simultaneously (generated using the 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.

Input forms are displayed by a number of commands, which are generally used to allow the user to enter new data or modify old data. The following commands display an input form for data entry or query purposes:

The DISPLAY SELECTION and MODIFY SELECTION commands display a list of records using the output form. The user can double-click on a record in the list, which displays the input form.

The import commands IMPORT TEXT, IMPORT SYLK and IMPORT DIF use the current input form for importing records.

The optional * parameter is used in conjunction with the form properties you set in the Design environment Form Properties window and the command Open window. Specifying the * parameter tells 4D to use the form properties to automatically resize the window for the next use of the form (as an input form or as a dialog box). See Open window for more information.

Note: Whether or not you pass the optional * parameter, FORM SET INPUT changes the input form for the table.

The following example shows a typical use of FORM SET INPUT:

 FORM SET INPUT([Companies];"New Comp") ` Form for adding new companies
 ADD RECORD([Companies]) ` Add a new company

In an invoicing database managing several companies, the creation of an invoice must be carried out using the corresponding user form:

 Case of
    :(company="4D SAS")
       FORM SET INPUT([Invoices];"Input";"4D_SAS")
    :(company="4D Inc")
       FORM SET INPUT([Invoices];"Input";"4D_Inc")
    :(company="Acme")
       FORM SET INPUT([Invoices];"Input";"ACME")
 End case
 ADD RECORD([Factures])



See also 

ADD RECORD
CREATE USER FORM
DISPLAY RECORD
DISPLAY SELECTION
FORM SET OUTPUT
IMPORT DIF
IMPORT SYLK
IMPORT TEXT
MODIFY RECORD
MODIFY SELECTION
Open window
QUERY BY EXAMPLE

 
PROPERTIES 

Product: 4D
Theme: Forms
Number: 55

 
HISTORY 

Modified: 4D v11 SQL
Renamed: 4D v12

 
ARTICLE USAGE

4D Language Reference ( 4D v16)
4D Language Reference ( 4D v16.1)
4D Language Reference ( 4D v16.2)
4D Language Reference ( 4D v16.3)