Introduction
Some data is so illogical that users can't be allowed to persist it in the database no matter what the circumstances. For example, entering a future date of birth or trying to create a record with an existing SSN should never be allowed.
Other times, there may be a business need to enter data that violates business rules, but nevertheless should be persisted and then left up to the user how to address the issue. Soft errors allow the application to flag this kind of data and then offer the user options to proceed.
In this example, the soft error will display if an order is not available.
Prerequisites
- The entity must have soft error condition configured.
- The soft error condition must be configured in soft constraint.
- The database must have a soft errors table for the entity.
- The messages table must have the messages configured with the appropriate severity level.
|
Quick Steps |
| 1 |
Search for and open the entity |
| 2 |
Add an expression |
| 3 |
Add the constraint |
| 4 |
Save the entity |
| 5 |
Open the entity configuration |
| 6 |
Add the error table, then click OK |
| 7 |
Add the status column |
| 8 |
Save the entity |
| 9 |
Open the maintenance form |
| 10 |
Update the form |
| 11 |
Add the status field |
| 12 |
Change the status field to a label |
| 13 |
Add the suppress warnings field |
| 14 |
Add a collapsible control |
| 15 |
Enter the properties, then click OK |
| 16 |
Add the Internal Soft Error control |
| 17 |
Save the form |
Detailed Steps
Step 1. Search for and open the entity.
This is the entity where you are going to add soft error details.
In this example, it is entOrder.
Step 2. Add an expression.
This expression will be used to determine the record's status.
In this example, if the order is not available (value is N), the expression is true and the record's status will reflect that the record is not valid.
The Message ID comes from the message record you want to use for the error. It has to exist before you create the expression.
Its Severity property determines how a user can address its linked error. In this example, Severity is Warning, so the user will be able to suppress the error.
Step 3. Add the constraint.
Add the expression as a soft constraint.
Step 4. Save the entity.
Click the icon to save the entity.
Step 5. Open the entity configuration.
Open the desired entity and click the Configuration icon.
Step 6. Add the error table, then click OK.
In the Soft Error Details tab, you are going to configure the soft error table. Click the + icon to add the error table.
Xelence displays the result once you create the error table. View the result and click OK.
Step 7. Add the status column.
You can add the existing status column by clicking the down arrow in the status column textbox or, if desired, click the + icon to add the required picklist column, enter the column name that you want to add, and select the picklist by clicking the arrow icon in the picklist textbox.
Step 8. Save the entity.
It saves the entity.
Step 9. Open the maintenance form.
This is the form where the soft error applies.
In this case, it is wfmOrderMaintenance.
Step 10. Update the form.
Drag and drop the Orderavailabilityind field from entity attribute to the desired location in the demographics section.
Update the UI as necessary to administer the error. In this example, the form must have the Order Availability checkbox so the user can either indicate the order is available or not available.
The control must be a checkbox.
Step 11. Add the status field.
Drag and drop the ErrorStatus field from entity attribute to the desired location in the demographics section. Add the field configured as the error table's status column.
In this example, that is the Error Status field.
The control must be a label because the Error Status is now determined by error results, not the user.
Step 12. Change the status field to a label.
This field's value is now determined by the entity's soft error constraints.
Step 13. Add the suppress warnings field.
This will allow the user to suppress wranings to change the status to Valid.
Update the caption if desired.
The captions have been changed for the added fields to make it more user friendly.
Step 14. Add a collapsible control.
Add a collapsible control where you want to display the form's soft error messages.
Step 15. Enter the properties, then click OK.
Enter a meaningful caption and the desired number of rows. This is probably 1, as you will usually display the soft errors by themselves.
Step 16. Add the Internal Soft Error control.
Drag and drop the control to the configured collapsible to display the soft errors collection (the collection only populates if the entity is configured with the error table).
The collection drops with automatically configured columns. Delete/rename/reorder as will best serve your users, if desired.
The internal Errors collection populates in the data table only if the entity is configured with the error table.
The Internal Soft Error control has been added to the Conditions collapsible control. For this control to work correctly, the entity must be configured.
Step 17. Save the form.
It saves the HTML form.
Then, run the Preview on the form. Save a record with the error condition met and it will update the status and display an error message where you configured the error collection.
If you suppress the warning, the app will ignore the condition when determining the record's status.
If you update the record, i.e. Order Availability is certified, so it no longer meets the condition, the app will update the status to Valid and remove the error from the error collection.
What are the improvements over S3 Version 6?
Earlier, the error collection grid used to get created in the entity attributes as soon as the user configures the error table and then the user would import an error collection grid from the entity attribute. Now, internal Soft Error control is present, user can directly drag and drop the control to the location.
Related Articles
Add an Expression
Add a Field Constraint
Make a Server Error Message Display the User's Invalid Entry
This post is part of the Maintenance Form topic. Click here to open the Maintenance Form Overview.
This post is also part of the Entity Form topic: Click here to open the Entity Overview
#Xelence
#Forms
#Entity