Add a form extension to a project

Completed

To add new functionality to a form, you need to create an extension of that form. Of the many reasons that you would extend a form, you can add a new control, enable or disable an existing control, or change a control's visibility. For example, you can add a new FastTab to a Details Master form or make a FastTab not visible.

You can modify properties for the form and its controls, such as the Label, Caption, or Help text. Modifying the caption will change the wording of the page in the user interface on a browser's address bar. You can also add a data source or a form part.

You can extend a form to implement event handlers that are called from the base implementations of form methods. An event handler is a way for you to write or copy code to a form that runs when a certain event occurs, such as when data is modified. Not all properties or controls can be edited when you create a form extension. For example, the Name property might appear dimmed in the Properties window, indicating that you cannot change it.

Some tasks can't be carried out by using an extension, for example, if you require a different form pattern and not all form patterns are available with an extension. In that case, you would create a new form, apply the necessary pattern, and then build the form according to the Pattern tab in the form designer window.

The following screenshot shows the addition of a tab to the Action Pane for the FMCustomer form extension, named FMCustomer.myExtension. A Button Group and Menu Item Button have also been added to the Action Pane Tab control. The existing elements in a form extension are shown in italic type, while the changed or added items are displayed in bold type.

This is a screenshot from Visual Studio of an FMCustomer form
extension with an added Action Pane Tab, Button Group, and Menu Item
Button.

If a form doesn't have the needed data sources or fields, you can create a form extension to make the necessary modifications. After you've created an extension of the form, add a data source in the same manner that you would add a data source to a new form. Depending on the form pattern that is used, you can use the fields in the new table or data entity to populate the Grid control.

Follow these steps to create a form extension and add a new data source:

  1. Locate the form that you want to extend in the Application Explorer window by expanding AOT > User Interface > Forms.
  2. Right-click the form and select Create extension. If this option appears dimmed, you will need to set your project to reference the model that contains that form.
  3. In the Solution Explorer window, right-click your form extension and select Rename. Add a company-specific suffix, such as .myExtension or .abcExtension.
  4. In the Solution Explorer window, right-click your form extension and select Open.
  5. In the Application Explorer window, expand AOT > Data Model > Tables.
  6. Select and drag your desired table from the Tables list to the Data Sources node of the form.
  7. Alternatively, you can select a table from your project in the Solution Explorer window and drag it to the Data Sources node of the form.
  8. Now that you have the new data source added, you can expand the table node and expand the Fields node within it to select and drag fields to the Grid control in the design pane.