Table of Contents |
---|
...
Introduction
Each field in any object can be extended by Smart field configuration. Smart fields calculate values based on related objects - in most cases ancestor objects (higher in the tree structure).
...
Text Compounder - a resolver that will create a field value based on selected values from one or more ancestor objects.
Auto Sum - a resolver that will calculate a sum of values present in child objects.
Math Basic operation - a resolver that will perform operation on given field and result will be put into main field.
Rule Based field - a resolver that will put desired value into a chosen field if given HQL condition is met.
Note |
---|
"Smart fields" updates fields without checking for Security Schemes or Field Level Security. |
...
Smart fields can be added in an Administrative panel. Please use the Add button to add new field or Delete to remove selected one.
...
On the new field form, select the following:
Class: Object class that should contain the custom field
Field: an existing field that will be affected (keep in mind that not all field types are compatible with custom fields)
Resolver: select from list o available custom field resolvers
...
Text Compounder
For this field to work correctly, we have to provide a set of information as show on this example:
...
Perspective - in most cases this will be the main perspective set used in Tree View to display basic object structure
Field formatter - this is a text string that can contain resolved values from objects indicated in grid below.
First, start with defining objecs
Secondly, when the object list is ready, use their sequence numbers to build custom string.
To enter value from given object, use it's sequence number in brackets, like so: {1}
Text Compounder Objects - Starting from source object (the one that contains custom field - in this case Rum), provide a list of linked objects going upwards in the structure.
In this example, we would like to access data in Rum object, hence it is first on the sequence
Second obnject will be its parent object of class Plan (Plan must have a direct link to Rum)
The third object will be of class Building (Building must have a direct link to Plan)
You do not have to use all objects, but there cannot be a gap between linking. For example, if we would like to create a field that contains only Building name,
...
The field value will be automatically calculated in specific situations:
When a new obejct is added and contains a smart field
When another object that is part of the smart field is updated (chanage of field value, change of location/link)
Supported field types
Text fields
Number Fields
Special fields (GUID, Serial)
...
For this field to work correctly, we have to provide a set of information as show on this example:
...
This is a sample configuration for a Building object, that will have a smart field showing area from all child floor objects.
...
Child class - provide a class name that will be selected from child objects.
Field - select a field that will be used to calculate sum.
Perspective - in most cases this will be the main perspective set used in Tree View to display basic object structure.
HQL - If this field is filled with /wiki/spaces/HHD/pages/2196038 condition then operation of auto-sum will be done only if this condition is met (condition must must apply to objects of selected child class).
Supported field types
All numeric fields - the value is used "as is"
Text fields for both source and target of the calculation.
If the selected field contains a number represented as text, it will be parsed into number and used
If the field contains text value, 0.0 will be used as a value for this field for the sum operation
...
Operation that will be done is defined on Basic operation field settings (right panel).
...
First, choose a perspective in which objects taken for Math operation will be used.
Class #1 - choose class of object that's field value will be used as first argument of math operation (it can be same object as main class object or it's ancestor based on chosen perspective).
Field
#1#1 - choose metadata field that's value will be used as as first argument of math operation.
Operation - choose math operation that will be performed.
Then select whether second argument will be a strict chosen number of it will be taken from another field.
...
Class #2 - choose class of object that's field value will be used as second argument of math operation (it can be same object as main class object or it's ancestor based on chosen perspective).
Field
#2#2- choose metadata field that's value will be used as as second argument of math operation.
Result of math operation will be put into chosen Object Class Field from main configuration (left panel).
Rule Based field
When configured, chosen class field will be given desired value if a HQL condition is met.
First add in Custom Fields panel new entry and choose Resolver: Rule based field.
...
Then in a panel for Rule based field settings add HQL condition and a value that will be added to selected field when condition is met.
...
Warning |
---|
Please note that there is no validation of value given with destination field type - if data is mismatched (ex. text put into numeric fields) than nothing will happen. |
...
Of course there can be more than one rule per field:
Rule based fields can be set to be triggered on object modified and Import Finished events.
Running plugin on demand can be done in single object or subtree mode, same as other custom fields.
...
In case a manual triggering of Smart Field is needed, it can be done through context menu on the Tree View:
...
Run of resolver is triggered for the selected object, but might affect objects lower in the structure, as described for specific resolvers.
...
Event column informs on which action specific resolver will be triggered if Run on events column is checked.
...
AutoSum and MathBasicOperation plugins will automatically be run only on editing of object that have fields present in plugin configuration.
TextCompunder and Rule based field plugin in addition to manual Edition, can trigger after object is added or edited in import process (will be part of import process).
...
Note |
---|
Sequence of automatic run of plugins is hard-coded as for now and is as follows:
|
...
Related topics:
Save area from spot to linked hierarchy object
...