Administering : Managing business rules and expressions : Business rules definitions : MatrixWriter business rule
  
MatrixWriter business rule
You can use the MatrixWriter business rule to display attribute values for an element in linked elements without clicking the elements links. If the attributes in the linked elements have the same name and type, this business rule works across modules and workspaces. The MatrixWriter business rule creates rows in a Matrix attribute and, based on linked elements, populates the cells with values. It creates one row for each linked element and fetches values from each element to populate the matrix.
Prerequisites
A Matrix attribute
A Link List or Incoming Links attribute
A Text attribute, to be the business rule container
Format
In the business rule container attribute, enter the business rule in this format:
=MatrixWriter("Link Attribute Name",
"Matrix Attribute Name","Column Number",
"Include Workspace","listen_to=Source Attribute Name",
'Link Attribute Name')
If you want the Matrix column headings to contain values besides the attribute names from the linked-in elements, add a parameter that holds the attribute names:
=MatrixWriter("Link Attribute Name",
"Matrix Attribute Name","Column Number",
"Include Workspace","Source Attribute Name",
"listen_to=Source Attribute Name",'Link Attribute Name')
To enable the values in a text attribute to be displayed as text rather than numbers, use the optional PreserveString parameter. Separate the attribute names with commas.
=MatrixWriter("Link Attribute Name",
"Matrix Attribute Name","Column Number",
"Include Workspace","preservestrings=Source Attribute Name",
"Source Attribute Name","listen_to=Source Attribute Name",
'Link Attribute Name')
Parameters
 
Parameter
Description
"Link Attribute Name"
The name of the Link List or Incoming Links attribute
"Matrix Attribute Name"
The name of the Matrix attribute, which is the target attribute
"Column Number"
The column that the matrix must be sorted by.
For example, "1" sorts according to the first column, and "title" sorts by row headers.
The column is sorted in ascending order. To sort in descending order, add r in front of the column number; for example, "r1".
"Include Workspace"
If the elements in the list are from other workspaces and you do not want to include the workspace names, set "Include Workspace" to false. Otherwise, set this parameter to true.
"preservestrings=Source Attribute Name"
Optional. Preserves text values from being converted into number format. If you add references to several attributes, separate them with commas.
"Source Attribute Name"
Optional. Include this when you want a parameter to hold the attribute names instead of inserting them in the Matrix headings.
"listen_to=Source Attribute Name"
Detects a specified attribute in linked elements.
You need one listen_to parameter for each attribute to display in the matrix. You can have as many of this parameter as you want to display. Add "listen_to=Source Attribute" one after the other.
'Link Attribute Name'
The name of the Link List or Incoming Links attribute
Go up to
Business rules definitions