Creating alternative editing forms for custom tables

Alternative forms allow you to create additional representations of existing forms, which you can then use in different situations. You can find more information in Creating alternative forms. In Code names of automatically used alternative forms, you can learn about special code names of alternative forms. If you create an alternative form with one of these names, it will be used automatically in the corresponding situation.

The following example demonstrates how to add an alternative form for the sample People custom table (created according to the instructions in Creating custom tables). You can repeat the same process for any other custom table. The example prepares a simplified alternative form that allows users to create records in the People custom table without a date of birth value.

Adding the alternative form

To create a new alternative form for the People custom table:

  1. Open the Custom tables application.
  2. Edit () the People custom table.
  3. Switch to the Alternative forms tab.
  4. Click Create new form.
  5. Type a Display name for the form.
  6. Type insert as the Code name. This special code name ensures that the administration interface automatically uses the simplified form when creating new records in the custom table.
    Creating an alternative form for a custom table
  7. Click Save.

The system creates a new alternative form for the custom table.

Configuring the alternative form fields

After you create an alternative form, you can change its fields using the field editor.

  1. Switch to the Fields tab.

  2. Select the DateOfBirth field.

  3. Disable the Display field in the editing form option.

    Instead of hiding the field, you can experiment with different settings of the field. Try changing the Form control type or the Field caption, or try changing the Editing control settings. This way, you can configure the alternative form as you wish.

    Disabling a field in an alternative form

  4. Click Save.

You have configured the fields of the alternative form.

Using the modified form

Because you set the alternative form’s code name to insert, it is automatically used in the system’s administration interface when creating new records for the People custom table.

  1. Open the Custom table data application and edit the People table.
    • You can also select the Data tab when editing the People table in the Custom tables application.
  2. Click New item.

You can see your modified alternative form when submitting a new record into the custom table (without the DateOfBirth field). If you edit an existing record, the original form with all fields is displayed (this editing form could be replaced by an alternative form with the update code name).

Displaying the alternative form on the live site (Portal Engine)

On Portal Engine websites, you can quickly add the custom table’s editing form onto pages using the Custom table form web part.

  1. Open the Pages application.
  2. Switch to the Design tab.
  3. Place the Custom table form web part on a page.
  4. Configure the web part.
  5. Select People (customtable.people) in the Custom table property.
  6. Click Select next to the Alternative form name property.
    • The alternative form takes precedence over the selected custom table’s default form.
  7. Choose the class (custom table) and alternative form in the displayed dialog and click Select.
    Selecting an alternative form
  8. Click Save & Close.

The alternative form appears on the page (without the DateOfBirth field). Users can submit the form to add new records to the custom table.