Displaying a grid as a list
You can reference a grid, and display it on another tab as a list. However, to do this correctly, you need to know how Operações de Marketing stores grids.
*
*
So, for example, if you have two projects created from the same template, the rows added by the corresponding grids in both projects are added to the same database table, but the grid for each project only has access to its own data.
To achieve this, a database table that holds grid data needs to have two columns: one to uniquely identify a row, and one to identify the parent ID: the ID of the project or marketing object that contains the grid.
The key column you set for a grid table (when you add a TVC Component to hold the data for the grid) holds the parent ID for the row. All rows in a single grid have the same value for this column. Thus, it cannot uniquely identify a row of data.
The Forms Editor auto generates a column, uap_grid_row_id, for each grid. A list view just requires a column that uniquely identifies rows. Hence, when you would like to use the same table as grid in a list view, you must specify uap_grid_row_id as the key column, not the key column you specified when you specified the grid data table.
To illustrate, look at this example:
*
*
*
*
The database table that holds the data for these two grids might look like the following:
Table with columns for object_id, uap_grid_row_id, manager, emp_id, emp_name, and salary
The first several rows belong to the grid on TRS001. The final few rows belong to the grid on TRS002.
Each project displays only its own portion of the data in this table. However, if there is a list that uses this table for reference, it displays all the rows in the table, as shown here:
Grid with columns for Employee ID, Name, Base Pay, and Manager
Since the column name uap_grid_row_id is reserved, you must not use this as a column name when creating a grid’s columns.
You can filter a list so that it displays only the grid entries from its own object (project or marketing object). Continuing the previous example, create a project that has two tabs:
*
Staff Form: contains a grid that you use to enter and edit members of the staff.
*
Staff List: displays the entries from the Staff Form grid as a list.
To ensure that only the entries from the current project are displayed on the list, filter on the parent ID of the list.
When you create the TVC Component for the list, set the following values:
*
*
Parent ID Column Name: object_id (as shown in the database table shown earlier for this example). This value must match the value in the Table Key Column for the grid TVC Component.