Conditional expressions
Accounting CS lets you insert conditional expressions for selected elements in the design grid of the Layout Designer to specify content to print only when the criteria for the condition are met.
Insert a new conditional expression
- In the design grid of the Layout Designer, select an element, then selectInsertandConditional Expression.
- Use the Condition grid to build a conditional expression.
The following table lists the operators available for the conditional expressions.
Operator | Description |
|---|---|
= | Equal to |
<> | Not equal to |
< | Less than |
<= | Less than or equal to |
> | Greater than |
>= | Greater than or equal to |
Has data | The selected item includes data |
Has no data | The selected item doesn’t include any data |
Contains | The selected item contains specified text |
Does not contain | The selected item doesn’t contain specified text |
note
- The operator field in each row of the Condition grid is preceded and followed by text fields. Select theFormulabutton to insert a formula, variable, amount, or text as part of the conditional expression. To enter static text for a condition to test, be sure to enclose that text within quotation marks.
- Existing conditional expressions are tagged with a green triangle on the element.
- You can build complex conditions by selectingANDorORat the end of a row in the grid, which opens another row to add to the condition. Note that you can keep building to the current condition beyond the 6 visible rows in the Condition grid. When you have filled the 6 rows, and then selectANDorORat the end of the 6th row, a scrolling region is displayed so that you can add more items to the condition.
- Multiple tabs are displayed in theConditional Expressionwindow only if more than 1 condition is set up for the current expression.
- A new tab is automatically added in theConditional Expressionwindow (for example, Condition 1, Condition 2, and so forth) when you select theTest next conditionoption.
Action conditions
If true, print
- Print element(marked by default): If the conditional expression meets the criteria specified, the selected element is included in the output for the layout.
- Print: If the conditional expression meets the criteria specified, the value in the field (including a formula and/or variable) is included in the output for the layout.
If false . . .
- Complete condition(marked by default): When you mark this option and the conditional expression doesn't meet the criteria specified, the selected element is not included in the output for the layout.
- Test next condition: If you mark this option, a newConditiontab is automatically inserted in theConditional Expressionwindow to let subsequent conditions be evaluated if the previous condition was not met.
- Print element: If the conditional expression doesn't meet the criteria specified, the selected element is included in the output for the layout.
- Print: If the conditional expression doesn't meet the criteria specified, the value in the field (including a formula an/or variable) is included in the output for the layout.
Edit an existing conditional expression
Select an element in the design grid of the Layout Designer where a conditional expression already exists, then select
Format
, Conditional Expression
.Remove an existing conditional expression
Select an element in the design grid of the Layout Designer where a conditional expression already exists, then select
Insert
, Remove Conditional Expression
.Conditional expression that prints only if the Net Check amount is greater than zero
If you are designing a check from scratch, you may not want to include several elements in the check when the account is set up for direct deposit. There is a common conditional expression that can be applied to variables, such as Bank Name (Payroll.Check.BankName), Routing number (Payroll.Check.BankRoutingNumber), Signature (Payroll.Check.Images.Signature), and MICR Line (Payroll.Check.MICRLINE) that enable you to print those elements only if the amount for that item is
greater than zero
. That way, those elements don't show up on zero-amount checks that are direct deposited to the bank. In the following example, we’ll apply the zero-amount conditional expression to the Net Check Amount variable.- Open a check layout in the Layout Designer.
- Select thePayroll.Check.NetPay.NetCheckAmountvariable in the check layout.
- SelectInsert, thenConditional Expressionto open theConditional Expressionwindow.
- Select theFormulabutton in the 1st field of the 1st row to open theFormulawindow.
- Select , then selectOKto close theFormulawindow.
- In theConditional Expressionwindow, select thegreater than(>) sign from the dropdown list in the 2nd column of the 1st row.
- Enter0in the 3rd field of the 1st row, then selectOK.
note
- You can only use double quotes ("), not single quotes (') when you enter text as part of the conditional expression.
- You can apply conditional expressions on layout elements, such as a text box, drawing/shape, variable, or a whole repeating region (yellow section).