Adding model references
While designing your data model, you might need to reference other model or sub-model objects. Object references are used to set up these relationships, and they are basically a special kind of field that just points to the referenced object in the database. For each object in the database, Altogic creates a unique id, and these ids can be used as reference object field values.
To add an object reference field to a model via the Designer, you need to Navigate to Models view and select the model that you would like to add the new object reference field.
There is no limit on the number of references added to a model. However, it is a good practice to limit the number of references to a minimum and instead, if possible, design these references as sub-model objects or object lists.
For example, you might have an inventory management application where you model your products in a model called "product." In this application, you can also have product procurement orders modeled as "procurementOrder." In each procurementOrder, you can have the product, quantity, supplier, and delivery date information. It would be an option to add the product as an object reference to the procurementOrder model. Thus, for each procurementOrder, the product field will point to a product model object.
To create an object reference in Designer:
- Select New field
- From the dropdown menu, select Object reference
- In the field name, provide a unique name (case insensitive) to your new object reference field, and on the Object reference properties, select the model or sub-model where this object reference field will point to
- Select Create