Creating alternative editing forms for custom tables

The alternative forms allow you to create alternative 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 given situation.

The following example demonstrates how to create an alternative form for the People custom table created according to the instructions in Creating custom tables. You can apply the same procedure to any other custom table.

Adding the alternative form

Imagine, you want to collect data from the site visitors into this custom table, but you do not need their date of birth. For this purpose, you can create an alternative form, where you will disable the DateOfBirth field.

  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.

    Creating an alternative form for a custom table

  6. 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 attribute 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.

Displaying the alternative form on the live site

Now you can display this custom table on the website using the alternative form. You can use 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.
    — or —

  4. Use the example web part on Corporate site -> Examples -> Custom tables -> Custom table form.

  5. Configure the web part.

  6. Click Select next to the Alternative form name.

    • The alternative form takes precedence over the selected custom table.
  7. Choose the class and alternative form in the displayed dialog box and click Select.

    Selecting an alternative form

  8. Click OK in the web part properties dialog.

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