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

Implementation Data Model New Dataobject

To add a new DataObject:

  1. In Object Name box, enter the name of the Dataobject.
  2. In Object Id box, enter an Id for the DataObject. The Id format should follow your standard naming convention, Eg new_objectid.
  3. Next, click on Add Extended Object Button to create the new DataObject.
  4. Once you have added a new extended object, you can find the new extended object by searching the object name in the search filter.
  5. Implementation Data Model New DataObject Search

  6. From the search results, click on the DataObject hyperlink to go to the Dataobject details.
  7. Implementation Data Model New DataObject Click

  8. From the DataObject details, you will be able to see that some default DataObject Items have been created.
  9. Implementation Data Model New DataObject Details

    *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

Implementation Data Model New DataObject Item Add

To add a new Dataobject Item to a new DataObject:

  1. Click on New Button to create a new line.
  2. 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.
  3. 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.
  4. In Item Num, this is automatically generated after the DataObject Item is saved.
  5. 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.
  6. In Source, select an applicable source. The default will be "Extended". In most cases newly created DataObjects are created as "Extended".
  7. In Db Column Name, this is not required when creating an "Extended" DataObject item.
  8. In Key Order, indicate a Key order if the DataObject item forms part of the unique key.
  9. In Allow Nulls?, check the box if null value is allowed for this DataObject item.
  10. In Default Value, enter a default value if it is not nullable and you wish to apply a default.
  11. In Tenant Num?, this should only be checked if the DataObject Item is tenantseqnum.
  12. In Unique Num on Insert?, check the box if this DataObject Item will auto-generate a unique running number.
  13. In Audited?, check this box if this DataObject Item should be included in Auditing.
  14. 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.
  15. In Decimal Precision, enter the Decimal Precision to be used if Type is "Decimal".
  16. In Decimal Scale, enter the Decimal Scale to be used if Type is "Decimal".
  17. In String Max. Length, enter the maximum length of the String if Type is "String".
  18. In Item Description, enter an applicable Item Description.
  19. In Extended Item Id, this is automatically generated after the DataObject item is saved.
  20. In Extended Index?, this should not be set without consulting CoreTRM Support.
  21. In Extendeded Num?, this is not used for "Extented" DatabObject Items.
  22. In Concurrency TimeStamp?, this is checked for DataObject item "updatedatetime" only.
  23. In Audit Num?, this is checked for DataObject item "auditseqnum" only.
  24. In Audit Create By?, this is checked for DataObject item "createuserseqnum" only.
  25. In Audit Create DateTime?, this is checked for DataObject item "createdatetime" only.
  26. In Audit Update By?, this is checked for DataObject Item "updateuserseqnum" only.
  27. In Audit Update DateTime?, this is checked for DataObject item "updateuserseqnum" only.
  28. 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
  29. For Example: fnIf(i:buysellcode,eq,B,Buy,Sell)

  30. Click Save Button to confirm creation.
  31. To edit DataObject Item after creation, Click Edit Button 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.
  • Implementation Data Model Search Dataobject

  • Click on the DataObject name to go to Data Object Details.
  • From DataObject Details view, Click on New Button 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.
  • Implementation Data Model DataObject Item Primary Key

  • 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.
  • Implementation Data Model DataObject Item Child Relationships

  • 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.
  • Implementation Data Model DataObject Item Child Relationships Criteria

  • 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":

    Implementation Data Model newitem

    1. 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.
    2. Next go to Item Lookups tab.
    3. Implementation Data Model newitem Item ookup

    4. From the Item Lookup view, click on New Button to create a new line.
    5. Implementation Data Model newitem Item ookup Setup

    6. In Item Id, select the DataObject item that requires Item Lookup Values. In this example, it will be newitem.
    7. 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.
    8. 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.
    9. In Description2, enter a 2nd description for the item value if applicable.
    10. In Inactive Date, select an inactive date if the item lookup value is no longer in use.
    11. Click Save Button to confirm creation.
    12. To edit item lookup details after creation, Click Edit Button 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:

    1. Go to DataObjects panel and search for "Dataobject Item Lookup".
    2. Implementation Data Model DataObject Item Lookup

    3. Click on the "Dataobject Item Lookup" DataObject to navigate to DataObject Details.
    4. Next go to Relationships tab.
    5. Implementation Data Model newitem Relationship

    6. In the Child Relationships panel, click New Button to create a new child relationship.
    7. Implementation Data Model newitem Child Relationship

    8. In Child Object Name, select the child DataObject. In our example is "NewDataObject" (where the newitem is).
    9. 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.
    10. 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.
    11. 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.
    12. Click Save Button to confirm creation.
    13. 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.

    Implementation Data Model newitem Child Relationship Criteria

    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.*

    Implementation Data Model newitem DataObject Item Num

    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)

    Implementation Data Model newitem DataObject Dropdown

    Back to top
    Hi! Have questions about CoreTRM? Chat with our AI or connect with our reps – we’re here to assist you!

    CoreTRM Assistant