Add CRUD forms

A generated application can include multiple forms.

This task assumes that you have created a BA diagram with a Program entity.

  1. Right-click on the open BA diagram and select New CRUD Form.
  2. Right-click the new form and select Implement CRUD Form from Database from the context menu.
  3. Select the database table and fields that you want to have on the new form (the products table, in our example). Finish and save the form definition file (4fdm) to your project.
  4. To call one form from another, create a second CRUD form by repeating steps 2 and 3.
  5. Right-click the first form icon and select New Relation. Click the Form icon again and drag the relation arrow to the second form.
  6. Select the relation arrow in the BA diagram and set the action property in the Properties view to the action name that you wish to trigger (products in our example).
  7. Save the forms and modified BA diagram.
  8. Build and run the program. A button is displayed on the calling form to trigger the action to call the secondary form. This button is added at runtime and can be removed by adding the action to the Toolbar and/or Topmenu. To do so, modify the default Toolbar (4tb) and/or Topmenu (4tm) files. Modify the action's display attributes by modifying the action defaults file (4ad).

    Figure: BA diagram with two forms


    This figure is a screenshot of a BA diagram with two CRUD forms.