Introduction
To prevent a user from entering data that doesn't make sense, you can configure controls to display only if conditions are met (client visibility) or to be disabled unless conditions are met (client enable).
You can set client visibility at either the control level or container level. This is useful for showing controls only when they are relevant. A maintenance form can have lots of controls. There is no reason to overwhelm users with fields, tabs, or even collapsible controls that don't apply.
Prerequisites
The form you are configuring must exist.
|
Quick Steps |
| 1 |
Open the form |
| 2 |
Open the Conditions and Actions tab, then add a new condition |
| 3 |
Enter the ID, then click OK |
| 4 |
Add a condition |
| 5 |
Configure the condition |
| 6 |
Add an If action |
| 7 |
Configure the If action |
| 8 |
Add an Else action |
| 9 |
Configure the Else action |
| 10 |
Save the form |
Detailed Steps
Step 1. Open the form.
Open the form you want to configure. This example uses the Order Maintenance form.
Step 2. Open the Conditions and Actions tab, then add a new condition.
This tab is where you can configure conditions for client visibility and client enable.
Click the plus icon to add a new condition.
Step 3. Enter the ID, then click OK.
Give your condition a descriptive name.
Step 4. Add a condition.
Click the Add Condition button to add a condition for the application to check. Generally, it is present by default.
Step 5. Configure the condition.
The details are:
- Control: Specifies the list of methods that return a value.
- Condition: Allows you to compare an attribute to a value or set of values by using an operator.
- Attribute: Allows you to enter the entity attribute.
- Constant: Allows you to enter a constant value for the attribute.
Operators are: In, NotIn, Like, Contains, Exists, Between, IsFalse, IsNull, IsTrue, IsNotNull, IsEqualTo, IsNotEqualTo, IsLessThan,
IsLessThanorEqualTo, IsGreaterThan, and IsGreaterThanorEqualTo.
If desired, before adding a record, you can choose the Collection ID for which the client enable and visibility condition needs to be configured.
This example's condition is "Communication Preference equals FAX" means the user cannot enter the Fax unless their Communication Preference is Fax.
Step 6. Add an If action.
Click the Add Action button in the If Configuration Actions section to add an action for the application to take if the condition is true.
Step 7. Configure the If action.
The important properties are:
- Action Type: Type of action the application will perform.
- Controls: Controls the application will apply the action to.
Action Type options are:
- Show: The application will display the Controls.
- Hide: The application will not display the Controls.
- Enable: The application will enable the Controls.
- Disable: The application will disable the Controls.
- Action: The application will enable saving the record, opening records, deleting records, etc.
- Script: When the condition is met, the application will run the defined script at the form/portal level.
- Control Formatting: The application will display the Controls in a selected format.
This example's action enables the Fax control.
Tip: This example uses one field, but you can also enable/disable/display/hide/etc. on the container level.
Step 8. Add an Else action.
Click the Add Action button in the Else Configuration Actions section to add an action to take if the condition is false.
Step 9. Configure the Else action.
The properties are the same as the If action.
Similarly, you can configure a condition for IsOrderStatus ID. You need to select the desired fields to enter the condition.
Add another record for when Order Status is Ordered. This forms a group. For either of the conditions to be true (Order Status as Opened or Order Status as Ordered), make sure you select the ANY condition from the drop down. You can also add multiple records at once by clicking the Group button.
Add an If action that the tab will be visible.
Add an Else action that the tab will not be visible.
Similarly, you can configure a condition for IsShipName ID. You need to select the desired fields to enter the condition.
Add an Else action that the fields will display.
Step 10. Save the form.
Then, run the Preview. Xelence displays the form output. You can test your updated settings.
When you have previewed your form, it should look something like this:
In this example, Communication Preference is Fax, so the Fax field is enabled.
In this example, Communication Preference is not Fax, so the Fax field is disabled.
Order Status is placed (ORDR) and Ship Name is entered, so the Customer Details tab is visible and the Shipper ID, Ship Address, Ship Postal Code, Ship Country, Ship State, and Ship City fields are also visible.
Order Status is Canceled (CANL) and Ship Name is not entered, so the Customer Details tab and Shipper ID, Ship Address, Ship Postal Code, Ship Country, Ship State, and Ship City fields are also not visible.
What are the improvements over S3 Version 6?
Previously, the options client enable and visible were available in the properties section of the control. Now, the configurations for this functionality can be done using the conditions and actions tab available in the form. Also, to this, multiple group conditions and actions can be added with not/and/any operators.
This post is part of the Maintenance Form topic. Click here to open the Maintenance Form Overview.
#Xelence
#Forms