Concept: Applying Condition Rules in Document Layouts
You can use condition rules to control the visibility of content in a document layout. When you create a document layout, the custom report you choose as the source defines the data fields and condition rules available in the layout, as well as the data included in the generated document. If changes are made to the data fields in the report, you can use the
Edit Document Layout
task to open the document layout, review the data fields and condition rules, and make updates as necessary. If the report that is associated with the document layout has boolean (true/false) data fields on the primary business object, those fields are automatically available for you to use as condition rules on the
Conditions
tab in the right panel, and you can apply them in the layout to show and hide content. If the condition is true when the document is generated, the conditionalized content displays, and if the condition is false or can't be evaluated, the content is hidden. Data fields on a related business object in the source report can't be used as conditions. Custom Condition Rules
In addition to having condition rules that use boolean data fields, you can create custom condition rules that use other data fields available from the source report. From the
Conditions
tab in the right panel, click the Create a Condition
button and select a Data Field
from the list of available data fields. You can create a custom condition rule using numeric, text, self-referencing, and single instance data fields for primary, self-referencing, and single instance business objects. Custom conditions display on the Conditions
tab along with the boolean data type conditions. However, custom conditions can be edited and deleted, while boolean conditions can’t.Using Condition Rules
To apply a condition rule to content, select the text or element in the document layout. Then, from the
Conditions
tab, click the +
icon next to the condition that you want to apply. The colored eye indicator that displays next to the condition rule matches the background color of the text or element on the page where you applied it. Click the eye indicator to show or hide the associated content on the page. You can apply a condition to an entire row or column in a table, but not to individual cells. To remove a condition rule, select the related actions menu next to the condition on the
Conditions
tab and then click Remove Instance
. This removes the condition applied to the selected content but doesn’t remove the condition from any other area in the layout that it is applied to. To remove a custom condition from all content, you can delete it from the Conditions
tab. If you edit or delete a custom condition from a document layout that has multiple language instances, you must open and republish each of the language instances separately to apply the updates.