Data Model
The CoreTRM Data Model allows each tenant to dynamically extend the data structure without accessing the database itself.
The default instance of CoreTRM comes with a default set of DataObjects. All DataObjects are classified by Types including Core, Extended, Security Model, User Interface, and System.
The Core DataObjects provide the starting data model for CTRM. The other Dataobject types such as Security Model and System are used by the underlying platform. New DataObjects added for a
tenant are typically classified as Extended DataObjects.
The Data Model is tenant specific and any additional DataObjects or DataObject Items are available to that tenant only.
To access the Data Model setup go to Data Model and then to the DataObjects tab.
Adding a new DataObject
Adding a new DataObject Item to a new DataObject
Adding a new DataObject Item to an existing DataObject
Creating a relationship between 2 DataObjects
Creating Item Lookup Values
Adding a new DataObject
To add a new DataObject:
- In Object Name box, enter the name of the Dataobject.
- In Object Id box, enter an Id for the DataObject. The Id format should follow your standard naming convention, Eg new_objectid.
- Next, click on to create the new DataObject.
- Once you have added a new extended object, you can find the new extended object by searching the object name in the search filter.
- From the search results, click on the DataObject hyperlink to go to the Dataobject details.
- From the DataObject details, you will be able to see that some default DataObject Items have been created.
*tenantseqnum, auditseqnum, createdatetime, createuserseqnum, updatedatetime and updateuserseqnum should not need to be modified. The system will also
automatically create a seqnum using your new DataObject name + seqnum as the key for this new DataObject. The unique key for the Dataobject will typically be tenantseqnum plus newdataobjectseqnum.*
Adding a new DataObject Item to a new DataObject
To add a new Dataobject Item to a new DataObject:
- Click on to create a new line.
- In Sort Order, enter a sort order number. It is suggested to follow the format and order number that has already been created when first creating new Dataobject items.
- In Item id, enter an unique id for the DataObject item. It should be meaningful as the Id will be used across the platform such as the View Builder.
- In Item Num, this is automatically generated after the DataObject Item is saved.
- In Item Name, enter an unique name for the DataObject item. It should be meaningful as the name will be used across the platform such as the View Builder.
- In Source, select an applicable source. The default will be "Extended". In most cases newly created DataObjects are created as "Extended".
- In Db Column Name, this is not required when creating an "Extended" DataObject item.
- In Key Order, indicate a Key order if the DataObject item forms part of the unique key.
- In Allow Nulls?, check the box if null value is allowed for this DataObject item.
- In Default Value, enter a default value if it is not nullable and you wish to apply a default.
- In Tenant Num?, this should only be checked if the DataObject Item is tenantseqnum.
- In Unique Num on Insert?, check the box if this DataObject Item will auto-generate a unique running number.
- In Audited?, check this box if this DataObject Item should be included in Auditing.
- In Type, select the applicable type for the DataObject Item. The commonly used types are : " Boolean", "Date", "DateTImeHM", "DateTimeHMS", "Decimal", "Double", "Int16", "Int32", "Int64" and "String". Any other types should only be used after consulting CoreTRM Support.
- In Decimal Precision, enter the Decimal Precision to be used if Type is "Decimal".
- In Decimal Scale, enter the Decimal Scale to be used if Type is "Decimal".
- In String Max. Length, enter the maximum length of the String if Type is "String".
- In Item Description, enter an applicable Item Description.
- In Extended Item Id, this is automatically generated after the DataObject item is saved.
- In Extended Index?, this should not be set without consulting CoreTRM Support.
- In Extendeded Num?, this is not used for "Extented" DatabObject Items.
- In Concurrency TimeStamp?, this is checked for DataObject item "updatedatetime" only.
- In Audit Num?, this is checked for DataObject item "auditseqnum" only.
- In Audit Create By?, this is checked for DataObject item "createuserseqnum" only.
- In Audit Create DateTime?, this is checked for DataObject item "createdatetime" only.
- In Audit Update By?, this is checked for DataObject Item "updateuserseqnum" only.
- In Audit Update DateTime?, this is checked for DataObject item "updateuserseqnum" only.
-
In Derived Function String, enter a derived function string if the value of this DataObject item is derived from other DataObject Items. If a Derived Function
is required, the Source must be set to "Derived". Derived function strings for commonly used functions instead of repeating the logic across views, alerts, etc
For Example: fnIf(i:buysellcode,eq,B,Buy,Sell)
- Click to confirm creation.
- To edit DataObject Item after creation, Click to edit.
Once a new DataObject is created, you will need to give security permissions to the DataObject in order to be able to insert, update or delete data from this DataObject.
To Give Security permission to an DataObject, you can go to Security Data -> Security Model -> DataObject.
Adding a new DataObject Item to an existing DataObject
To add a new Dataobject item to an existing DataObject:
In Data Model -> Data Object view, search for the existing Dataobject you intend to add a new DataObject Item. For Example, Contract Item.
Click on the DataObject name to go to Data Object Details.
From DataObject Details view, Click on to create a new line.
See Adding a new DataObject Item to a new DataObject for item details.
Creating a Relationship between 2 DataObjects
2 DataObjects can be linked to each other by creating a relationship between them. Once a relationship is created you will be able to easily retrieve items from parent and child objects.
Relationships can be used to enforce data integrity and to avoid the need to save derived data at different levels of the data model.
For example, we are going to create a new DataObject name : NewDataObject with primary key newdataobjectseqnum and create a relationship with Contract DataObject.
To create a relationship between newdataobject and Contract DataObject:
Assuming that you have already created the new DataObject NewDataObject. See creating a new DataObject for more info.
Next we need to create a new DataObject Item in the Contract DataObject. Typically, the new DataObject Item name will be the same as the primary key of the other DataObject. In our example, it will
be newdataobjectseqnum.
Once the new DataObject Item is created in Contract DataObject, navigate back to "NewDataObject" DataObject and to the Relationships tab.
From the Child Relationships panel, create a new Child relationship with Contract DataObject. Select the Child DataObject and enter an Alias id and Item Name Prefix.
From the Parent to Child Relationships Items and Parent Fixed Criteria panel, create new criteria linking the primary key of NewDataObject's newdataobjectseqnum to Contract DataObject's newdataobjectseqnum.
Once this is done, you will be able to easily query and access items from parent and child objects.
Creating Item Lookup Values
DataObjects also provide Item Lookup Values which can be used for simple code / descriptions pairs where the data is fairly static. If the data changes regularly or should be maintained by the client then a new DataObject should be used instead.
Below is an example of adding Item Lookup Values for a DataObject Item "newitem":
- Items associated with Item Lookups should be of String type with length of 20. Once you have identified or created a DataObject item that requires Item Lookup Values.
- Next go to Item Lookups tab.
- From the Item Lookup view, click on to create a new line.
- In Item Id, select the DataObject item that requires Item Lookup Values. In this example, it will be newitem.
- In Item Value, enter an unique id or value for Item Lookup. In this example, we will create 2 item values: V1 and V2 for displaying 2 values in the dropdown.
- In Description, enter a description for the item value. In this example, we will create 2 Descriptions: Value1 and Value2 which will be used for selection in the view.
- In Description2, enter a 2nd description for the item value if applicable.
- In Inactive Date, select an inactive date if the item lookup value is no longer in use.
- Click to confirm creation.
- To edit item lookup details after creation, Click to edit.
*Repeat the same process if there are more than one item lookup values.*
Once the item lookup values are setup in the DataObject Details, next you will need to create a Relationship, to ensure data integrity, from this DataObject to the DataObject "DataObject Item Lookup".*DataObject Item Lookup* DataObject is found in the Data Model group.*
To create a Relationship with the *DataObject Item Lookup* DataObject:
- Go to DataObjects panel and search for "Dataobject Item Lookup".
- Click on the "Dataobject Item Lookup" DataObject to navigate to DataObject Details.
- Next go to Relationships tab.
- In the Child Relationships panel, click to create a new child relationship.
- In Child Object Name, select the child DataObject. In our example is "NewDataObject" (where the newitem is).
- In Relationship is Optional on Child indicator, select if the relationship is optional. In our example, check the box since the relationship will be optional. Optional means that this value can be empty when a new data row is created.
- In Alias id, enter an alias id for this child relationship. In our example, "newitem". Refer to existing Relationships to see the common way of naming Alias Ids.
- In Item Name Prefix, enter an item name prefix for this child relationship. In our example, "newitem". Refer to existing relationships to see the common way of naming item name prefixes.
- Click to confirm creation.
- From the "Parent to Child Relationship Items and Parent Fixed Criteria" view, create criteria for this child relationship.
For creating relationship for Item Lookup values, typically 2 criterias are need. They are criteria for dataobjectitemseqnum and itemvalue.
In our example, dataobjectitemseqnum will be equal to the fixed value of the DataObject Item Num.
*DataObject Item Num is found in the DataObject setup as per below.*
For itemvalue, it will be equal to the Child Item Id of the DataObject Item which is "newitem".
Once this relationship is created correctly, the user will be able to select the value from a dropdown list as below: (Proper setup of the View Builder is also required)
Back to top