Calculated properties
Normally, a property of an object is followed by a storage location for the value of the property for each object of the class that defines the property. For a text attribute, for example, a text can be saved for each object that has this attribute. The same applies to references. The assignments that are delivered when accessing a reference are normally stored in the database.
However, there are cases in which you want to display information for an object that was not entered directly elsewhere, but is calculated from other information. A calculated attribute corresponds to an Excel cell in a spreadsheet for which a formula is stored. Instead of displaying the value entered in this cell, the cell then displays the result of the calculation rule stored in it.
Creating calculated properties
A calculated property (attribute or reference) is created in the same way as a normal property. However, the calculation rule to be evaluated is also stored in an adjustment.
When creating the attribute, select the "Storage rule" customization. This allows you to enter a function expression that is evaluated on the current object for which the calculated property is to be displayed.
Define calculation function
The function expression is a TL script function that is passed the current object as an argument and can access its other properties and perform navigation operations from this object (see Functions). The result of this function evaluation is then displayed in all places where the calculated property is displayed.