Insert Into Two Tables Wizard

The purpose of this wizard is to simultaneously insert data into two linked tables. The tables must be in a master-detail relationship. The wizard will add two insert forms into the page, one for the master table, and the other for the detail table. The field containing the link between the tables is automatically filled by the wizard.

The Insert Into Two Tables Wizard is accessible from two locations:

 

In order to use the Insert Into Two Tables Wizard, follow the next steps:

  1. Create two tables that are in a master-detail relationship, through the use of a foreign key.
  2. Apply the Insert Into Two Tables Wizard from the MX Kollection tab of the Insert bar.
  3. Move on through the wizard's steps by clicking the Next button. Configure each one, as shown in the instructions below:
    · Step 1: select tables to use.
    · Step 2: select master table fields.
    · Step 3: select detail table fields.
    · Steps 4 and 5: set validation options.
  4. When all desired options have been configured, click the Finish button to apply the wizard.

The wizard adds two forms in the page, one for the master table and one for the detail table, two Insert Transaction server behaviors and a Link Transactions server behavior. If MX Form Validation is installed, two additional Form Validation server behaviors are added, one for each table's fields.

Select tables to use

The first step in the wizard requires the user to select which tables to use. Table information is retrieved through the user interface selected connection:

 

To set this dialog box's options, follow the next steps:

  1. In the Connection drop-down menu select the database connection you've already created or your site. If you do not have any connections created yet, you can click on the Define button to create it now.
  2. In the Master table drop-down menu select the table that acts as the master in the table pair.
  3. In the Primary key column drop-down menu select the master table's field that contains the unique, primary key.
  4. The Numeric checkbox indicates whether the field selected as a primary key is of numeric type or not. Its state changes when different field types are selected.
  5. In the Detail table drop-down menu select the table that acts as the detail in the table pair.
  6. In the Primary key column drop-down menu select the detail's table field containing the primary key.
  7. The Numeric checkbox indicates whether the field selected as a primary key is of numeric type or not. Its state changes when different field types are selected.
  8. In the Foreign key column drop-down menu select the detail table's field containing the link to the master table.
  9. In the After inserting, go to text-box enter the page which will be opened after the insert operations complete successfully. You can either enter the file name by hand, click the Browse button to search for the file in the local folder structure, or use the InterAKT Dynamic Data lightning icon to construct its name from dynamic variables.
  10. The five buttons in the lower part of the interface offer the following functionalities:
    · With the < Back / Next > buttons you can navigate through the wizard's steps.
    · Click Finish when you are done configuring the wizard.
    · Click Cancel to exit without the new settings to be applied.
    · The Help button brings you to this help page.
    These buttons appear on all five interfaces of the Insert Into Two Tables Wizard.
  11. Click Next to continue with configuring the wizard.

Select master table fields

The second step requires the user to configure the master table's field that will be used in the transaction. They will have a visual counterpart in the form, and will be used in the SQL transaction:

 

To set the dialog box options, follow the next steps:

  1. In the Form fields area specify the form objects you want to include on the HTML form of the insert page, and which columns in your database table each form object should update.
    By default, ImpAKT3 creates a form object for each column in the database table. If your database automatically generates primary key ID's for each new record created, remove the form object corresponding to the primary key column by selecting it in the list and clicking the Minus (-) button. This eliminates the risk of the user entering an ID value that already exists.
    Use the Plus (+) button to add form fields to the current transaction.
    You can also change the order of the form objects on the HTML form by selecting a form object in the list and clicking the up and down arrows on the right top side of the dialog box.
  2. Specify how each data-entry field should be displayed on the HTML form by selecting a row (single click) in the Form fields area and entering the required information in the boxes below the grid.
  3. In the Label text box enter a descriptive label to display beside the data-entry field. By default, the column’s 'generic name' is displayed (MX Kollection 3 removes the part in the column name that starts with "_" and capitalizes the first part).
  4. In the Display as drop-down menu select a form object to serve as the data-entry field for the current selection in the grid. You can choose from the following list: Text field, Text area, Menu, Hidden Field, Check box, Radio group, Password field, Text, File field. To read the detailed description for each of these options, click here.
    Set the form object’s properties. You have different options depending on how you want the form field to be displayed as.
  5. You can use the Back button to alter the table and redirect information. If you do not wish to validate the user input, you can click on Finish to add the Insert Record elements to the page. If you want to go to the third and last step of the wizard, click Next.

Select detail table fields

The third step requires the user to select the detail table's fields to use. It is identical as usage and interface with the second step: Select the master table fields.

Set validation options

The fourth and fifth steps only appear if the form validation component has been installed, either as part of MX Kollection 3, or as a separate extension, and allow setting validation options for the master and detail table fields. For instructions on setting the dialog box options, see the Form Validation in wizards chapter.