Use of View Instances
View Instances is defined as one or more subsets of rows of a single entity table. A read method that outputs to a single table, may be shown as is, or horizontally split into 2 or more views.
Each split is defined by "filters" (SQL where condition) on the table. The filters are complex in nature that a user defined function with parameters may be used to filter the data for each view.
The rows in a view will remain the same as long as there are changes to the underlying data. On any change to a row, the row may remain in the view or move to other views, or show up newly in a view.
The goal here is to reuse single copy of data.
Sample schema as below,
{
"Entities": [
"EmployeeEntryNew"
],
"EntitiesToRelate": [
{
"EntityName": "EmployeeEntryNew",
"TableName": "EmployeeEntryDetails"
},
{
"EntityName": "EmployeeEntryNew",
"TableName": "EmployeeEntryDetails",
"ViewInstance": 1,
"ParentEntityName": "EmployeeEntryNew",
"ParentTableName": "EmployeeEntryDetails",
"ParentViewInstance": 0
},
{
"EntityName": "EmployeeEntryNew",
"TableName": "EmployeeEntryDetails",
"ViewInstance": 2,
"ParentEntityName": "EmployeeEntryNew",
"ParentTableName": "EmployeeEntryDetails",
"ParentViewInstance": 0
},
{
"EntityName": "EmployeeEntryNew",
"TableName": "EmployeeEntryDetails",
"ViewInstance": 3,
"ParentEntityName": "EmployeeEntryNew",
"ParentTableName": "EmployeeEntryDetails",
"ParentViewInstance": 0
},
{
"EntityName": "EmployeeEntryNew",
"TableName": "EmployeeEntryDetails",
"ViewInstance": 4,
"ParentEntityName": "EmployeeEntryNew",
"ParentTableName": "EmployeeEntryDetails",
"ParentViewInstance": 0
},
{
"EntityName": "EmployeeEntryNew",
"TableName": "EmployeeEntryDetails",
"ViewInstance": 5,
"ParentEntityName": "EmployeeEntryNew",
"ParentTableName": "EmployeeEntryDetails",
"ParentViewInstance": 0
},
{
"EntityName": "EmployeeEntryNew",
"TableName": "EmployeeEntryDetails",
"ViewInstance": 6,
"ParentEntityName": "EmployeeEntryNew",
"ParentTableName": "EmployeeEntryDetails",
"ParentViewInstance": 0
}
],
"Commands": null,
"LanguageCode": "en-US",
"IsPageLevelConnection": false,
"LimitToRequestedEntities": false,
"MenuId": 80099,
"PageId": null,
"PageName": "Modules/PoisePayroll/Employee/EmployeeEntryNewTwo.html",
"ApplicationModeIds": null
}
You will see "ViewInstance": 1,2,3,4,5,6 – Each of them represents the child tabs 1 to 6. The parent tab is "ViewInstance": 0
Set the appropriate ViewInstance for each tab, and use appropriate ViewName (for what columns to show).
This should result in a single copy of table (with ViewInstance=0) to be reused on all other ViewInstances(1,2,3,4,5,6).
ViewInstance = 0 --- is the original data
ViewInstance > 0 - refers to the original data