Used by: Field procedures, Form procedures
Use this procedure step type to perform different operations depending on a logical condition. For example, change the fill color of the Order Total field on a customer order if its value exceeds the maximum order limit of the customer. Or, for adding delivery charges based on order choice.
This procedure step type is available on all form procedures and many field procedures.
‘Case On Conditions’ is based upon two types of conditions:
- Choice field with a case for each choice in the field
- Conditions where a case tests a form definition producing logical (true/false) results or whether a or choice field choice is selected.
‘Case On Conditions’ is a special procedure step type in that it can perform multiple additional procedure steps including ‘Case On Conditions’. So ‘Case On Conditions’ can be embedded within ‘Case On Conditions’ to multiple levels as needed.
Available procedure steps types for a case:
- Do nothing
- Case on conditions
- Set properties on a form element on a form
- Set properties on a form or detail line
Based On Conditions
When ‘Case On Conditions’ is based on Conditions it starts with a default ‘Otherwise’ case. This means the default case is selected when none of the cases match their conditions.
Add more cases for each additional logical condition you need. Similar to adding procedure steps click the "plus-up/down arrow" edit control at the far right side of an existing case to add a new case above or below.
What is a logical condition?
A logical condition produces a true or false result. For example, a form definition testing the customer order total is greater than the maximum order limit for the customer. This produces a true or false value. Additionally, you can use individual choices from a choice field. Either the choice is selected or it is not - equivalent to true or false.
When ‘Case On Conditions’ is based upon Conditions then you must add case statements if you need to handle various conditions.
For each case added you need to select the logical condition to test for the case. Click on ‘Select case condition’ to open the field chooser. This gives you access to all reachable field definitions and fields with logical values (e.g choice field choices).
When your Formever system is operational and a ‘Case On Conditions’ procedure step is performed (either when triggered by a field procedure or form procedures) each case starting at the top of the list is evaluated. The first case that has a ‘true’ condition at that time will be performed and the remaining cases are ignored.
Based On Choice Field
When ‘Case On Conditions’ is based upon a choice field a case statement is automatically created for each choice in the choice field. (See image at top of page). Add procedure step types to those cases that you need to perform some operation.
If the choice field is configured to allow no selection then a case ‘Nothing chosen’ is also created as the last statement in the ‘Case On Conditions’. Use the ”Nothing chosen’ case to perform actions when no choice has been selected in the field. If the choice field is configured to not allow no selection then a case ‘Nothing chosen’ is not provided.
Unlike ‘Case On Conditions’ is based upon conditions you can not add or delete cases. Neither can cases be moved.
When your Formever system is operational and a ‘Case On Conditions’ procedure step is performed (either when triggered by a field procedure or form procedures) each case starting at the top of the list is evaluated. The first case that has a ‘true’ condition at that time will be performed and the remaining cases are ignored.
Context Sensitive
For example, consider ‘Case On Conditions’ when used in form procedure ‘Validate before filing’ versus when used in quantity field procedure ‘On every change’ . When used in ‘Validate before filing’ form procedure the ‘Case On Condition’ only offers the procedure step type ‘Stop the form from posting with a reason’. While in the field procedure it offers standard set: ‘Set the properties of a form element on a form’, ‘Case on conditions’ and ‘Set the properties of a form or detail line’.