2.3 Data Sources
This topic provides the systematic instructions to create Data Sources for Maintenance screens.
- On the Function Generation screen, right-click the
Data Source node and select the
Add option to create a new Data Source.The AddTable window displays.
- On the AddTable window, select the Table
Name from the list of values to get the list of tables available
and select the required table from the list.If the user knows the exact Table Name, the user can specify the name directly.The Data Source window is displayed.
- Select Master as Yes if the added data source is Master Data Source for the screen.Every function id should have one master data source.
- Verify Primary Key columns and Primary Types fields are populated and if its not entered then specify the Pk Cols and Pk Types fields.Primary Key columns (i.e. Pk Cols ) and Primary Types (i.e. Pk Types) are mandatory. If it is already maintained in user schema in STTB_PK_COLS it will populate automatically otherwise the user needs to enter values without fail. If the user misses Pk Cols and Pk Types package generation will fail.
Note:
Master Data Source cannot have any parent. - Click the Save icon at the top right of the
screen.The Data Source Details screen displays.
Figure 2-6 Providing master Data Source Properties
- Under the DataSource node, right-click the added table
(STTM_CUSTOMER) to add fields to the table.The Data Source Details screen displays with added table.
Figure 2-7 Including Data Source Fields for the Data Source
- Select the Add option to add fields to the table.The Select Fields window displays.
- Select the required fields and click Ok button.The selected fields will get added to the Data Source Tree.Provide Data Source Field Properties: Only maximum length can be modified by the developer in Data Source Field Properties. Rest will have defaulted from the table definition.
The data model of a single function id would include multiple tables. All the tables need to add to the function id. Note the following while adding child data sources.
- To add Child Data Source, follow the below steps:
- In Data Source Details screen, select Multi Record value as Yes if the child data source is Multi record table.
- Child Data sources should always be associated with a parent.
- Relation is mandatory between parent and child. While giving relation,
the parent data source should come on the left side of the
relation.
Note:
A data source cannot be the parent to itself.Figure 2-10 Providing properties for Child Data Source
- Note the following while adding data sources:
- If the data source is designed with relation type as 1: N with its parent, then it should have at least one more Pk Col than its parent (assuming the relationship is based on Pk Cols).
- Master data source needs to have the audit columns if footer template is Maint audit, but those should not be added to data source fields as the system will handle it.
Parent topic: Screen Development