When the solution matters

Tips...

Registration Documentation Knowledgebase Seminars / Training Technical Support Partner Central

Step 4) Forms in 4th Dimension

Prerequisites

About Forms

Forms in 4th Dimension provide the interface through which information is entered, modified, and printed. A user interacts with the data in a database using forms and prints reports using forms.

Each table in a database generally has at least two forms. One form is for listing records on-screen and the other form displays one record at time and is used for data entry and modification. The form that lists records is called the output form or list form and the form that displays one record at a time is called the input form or detail form. When you are viewing records using the list form, you can double-click a record to view the record using the current detail form.

The form is the interface object that you use for data entry, for listing records, for printing reports and mailing labels, and (in custom applications) for custom dialog boxes and palettes.

The Form Wizard is your starting place for creating any type of form. With the Form Wizard, you can create a new form by choosing the desired fields from a list and the desired form template from a drop-down list. Form templates control the appearance of forms. A template specifies such characteristics as form size, platform interface, font attributes, and buttons.

form wizard screen shot

The Form editor is an object-oriented drawing environment that lets you customise forms by manipulating objects on the form directly. For example, you can reposition objects, add objects not supported by the Form Wizard, create multi-page forms with tab controls, enforce business rules by specifying data entry constraints, specify form access privileges, associate a custom menu bar with a form, and write form and object methods that run automatically when the form is used.

form editor screen shot

Forms can be created either using the Form Wizard, or from scratch. The Form Wizard provides the developer with a quick way to create nice looking forms, and the ability to save template definitions for future use. Alternately, forms can be created manually from scratch.

Your database can use a large number of forms that perform specific functions. In custom applications you can use the language to control which forms are the active input and output forms. For example, you may want to switch sets of forms depending on whether the user is using a monochrome or color monitor. You can also use the language to use different sets of forms for Web browsers and 4D Client users. When you write a custom application you can create forms for use as custom dialog boxes or floating palettes. In custom applications, you can also use multiple processes to allow users to work with several forms simultaneously.

A form can display fields from more than one table. You can place fields from a related One table on a form and allow users to enter values directly into the related One table. You can also include a subform that displays a list of records from a related Many table. A subform displays a list of records from another table or a subtable in the master table. With a subform, the user can view, enter, and modify records in another table. For example, an invoicing application would use a subform on the invoicing input form that lets the user enter line items for the Invoice. Although the line items appear on the invoicing screen, the line item records are actually stored in a related Many table.

A form used for data entry can have more than one subform. For example, a contacts manager database can use a subform for telephone numbers, another subform for To Do’s, and another subform for prior contacts with the person. Each subform displays records from a different related Many table.

A particular form can use some of the fields in a table or all of the fields. You might have two input forms, for example – one for use by a clerk and one for use by supervisors. – neither of which contains all of the fields. You might use another group of fields for the screen display and yet a fourth group for a printed report.

Each form has one or more display pages in which fields and other enterable objects appear. If your fields don’t fit on one page, you can create additional pages. When you create a multi-page form, you also add buttons or a tab control to allow users to move from one page to another.

Each form also has a background page (a page zero) on which you place objects that appear on all display pages. Use the background page to place background graphics, buttons, a tab control, and other graphic objects that define the “look” of the page, such as rectangles and labels.

There are two kinds of objects in a form: active objects and graphic objects.

Active objects perform operations on data or provide a customised user interface. Active objects include the following:

Graphic objects are geometric or textual elements that enhance the appearance of the form. Graphic objects include the following:

All objects, whether active or graphic, are handled in the same way in the Form editor — they are created by being drawn or dragged and dropped; they can be selected and moved or resized; they can be duplicated, cut, copied, and pasted; they can be aligned to each other or to an invisible grid; and their appearance can be changed.

Object Propertiesobject properties screen shot

Each object has a set of properties. For graphic objects, properties include foreground and background color, line width and fill pattern, resizing and repositioning options, and font size and attributes. For active objects, properties may also include the object’s relationship to data, the object’s “action” when it is used, a help message, and the object’s method. When the Form Wizard generates a form, it assigns appropriate default properties to both graphic and active objects; you can modify these properties in the Form Editor.

Graphic objects have no impact on the data. You can create a graphic object on a form simply by drawing it and making any necessary modifications to its appearance. For example, when you create a text area, you draw the area, then you type the text you want to display. You can change the text at any time without affecting the data.

Active objects require instructions about their relation to the data or instructions on the actions that they are to perform. In simple cases, the Form Wizard does everything for you. Entry area for fields are automatically associated with the appropriate field in the database structure and buttons automatically perform the appropriate actions. In other cases, you can specify additional instructions in the Form Editor using the Object Properties window. For example, you can assign special instructions to a button by writing a method. The method remains attached to the object as one of its properties. If the object is copied and pasted, it retains all its properties, including its method.

Learning Resources

Creating forms for data entry and display using the Form Wizard
4D Design Reference, Chapter 3, Pages 194 – 226

Working with the Form Editor
4D Design Reference 6.7, Chapter 4, Pages 227 – 322

Working with Fields and Active Objects
4D Design Reference 6.7, Chapter 5, Pages 323 – 436

Output Displays and Reports
4D Design Reference 6.7, Chapter 6, Pages 437 – 476

Form Events & Form Pages

Converting Screens from FileMaker to 4D
From FileMaker to 4D, Chapter 8

Input forms
Programming 4D – The Ultimate Guide, Chapter 20

Output forms and subforms
Programming 4D – The Ultimate Guide, Chapter 21


International | Company | Contact 4D | Site Map | Privacy Policy | © 4D UK 1995-2008 | Change font size: [A] [A] [A] | Print this page