Credits to @m.gechev. Original is KB1670
Record Link Field
Since revision 115202, the Expression tools plugin provides a UI element in the architect that can be used to create a link to another record in the application.
This field is of numeric type and in a sense, it is an autocomplete element - just like search links. However, compared to search links, it can be configured to accept records of any type, whereas the search link can contain only one data type defined in the architect. This functionality allows making records like the ApplicationLogs much more lightweight.
Before the introduction of this Record link field, if one wanted to add a link between record X and Application logs, they would have to create a search link on the application logs. The same applies for record Y and any other record type that needs linking.
This process is now much easier with the usage of the Record link field. In combination with the DataStructure DataType field (which is mandatory for the usage of the Record link field), one record link field can contain any record type.
Dependencies
Data structure plugin is needed for the DataStructure DataType field.
Configuration
DataStructure DataType field
The configuration for this doesn’t really matter, as long as it’s valid. The field needs to be filled in with a valid Novulo record datatype string.
The Record Link field
- Has only one configuration item: “Data type field”, which is used to provide a reference to a DataStructure DataType field.
- The value of the record link field is the ID of the record to which the link should be made.
Example Configuration and Usage
In the architect, in my test model, I have the following on the application logs:
- Both fields are not editable - the idea is to set these via Process (example will follow)
- DataStructure datatype field with the following configuration:
- Record link field with the following Plugin configuration:
Additionally, I created a function on the application logs, which implements an AliasDataFunction provided by the plugin (will become relevant). This allows for a more optimized way to create grids on such linked records to easily find which Application logs (in this case) belong to my record:
This is the AliasDataFunction to implement:
- Parameter: my current record
- Return value: boolean
- Under the hood, an expression string is built and evaluated which finds the combination of DataType and recordId that match the current record
Configuration:
I use the RecordLink field to create a link between the application logs and a test record, “WhoAmI”. On the WhoAmI record I have:
- A process to create an application log which is linked to my current WhoAmI record
- A grid with application logs that are linked to the current WhoAmI record
-
The filter for the application logs grid uses the AliasDataFunction which was implemented above. It is used like this:
-
ParentContext returns the current record, which is the parameter for the function
-
Creating Record Links
To create a link between the ApplicationLogs and another record, one way (and the intended supported usage of this combination of plugin items) is as follows:
In a process, I have the parameter record (in my case it is the trigger) which I want to create a link to.
Using expression tools EvaluateExpression plugin action, I retrieve the DataType of the record to link (this is the input for the DataStructure DataType field)
Then I create my application log:
- The DataStructure DataType is the evaluate expression .resulttype from the return values
- The record link field gets the Id of the record to link (in my case, I can use trigger.id)