Skip to main content

Helpcenter

Create Objects With Data from Multiple Tables

You can create objects with data from multiple tables, compared to batch generation where objects are always created for one table only.

  1. Go to Integrate > Data > Datasource.

  2. Open an existing, working SwatEntity and click the Copy button.

    The Copy Object Dialog opens.

  3. Enter an appropriate name in the Name of new object field. It can contain for example all included tables.

  4. Select the SwatEntity to be copied in the Source Object field.

  5. Click the Ok button.

  6. Adjust the following attributes in the Attributes panel :

    1. SourceTables: Insert all the required tables comma-separated, following the naming convention <databasename>.<tablename>.

    2. SourceQuery: Adjust the query to the needed one.

      Example ABL:

      FOR EACH table1, 
      EACH table2 OUTER-JOIN WHERE table1.keyA = table2.keyB, 
      EACH table3 OUTER-JOIN WHERE table2.keyC = table3.keyD 
      INDEXED-REPOSITION
    3. EntityName: Adjust the name (last part) to the name of the previously created entity.

  7. Open the Instances view of the created SwatEntity and drag & drop your needed data fields from the previously specified tables into the Instances (children) of this Object panel.

  8. Click Save.

  1. Go to Integrate > Data > Entities + Fields and click the Generate Datasources button.

  2. Enter the needed information and click the Ok button to create the DSO.

  1. Open the created DSO in the Object Designer, open the Instances view and select the entity.

  2. In the Attributes panel, enter a name in the name attribute and add an 'e' prefix to the name.

  3. Open the Design view again.

  4. In the Attributes panel, enter the same name previously entered in the name attribute in the EntityName attribute.

  5. Test your new DSO by opening the URL [YOUR CURRENT GITPOD URL]/web/Resource/[RESOURCENAME OF THE DSO].

    Note

    The resourceName for the URL is the name in the resourceName attribute of the DSO.

  6. To Create the desired objects for the previously created entity, e. g. a grid, go to Design > Components > Grids and click the Generate Grids button.

    1. Enter a Name by following e.g. the naming convention <name><objecttype>, a Title and a Description.

    2. Select your created entity in the Entity drop-down field.

    3. Select the desired fields. You can also type in an asterisk * to select all fields.

    4. Select the desired module.