The following example illustrates how to set a minimum value for a control.
Suppose a Transportation and Logistics company has defined a process called Shipping Process, to manage and monitor international shipments. The first task of this Process allows the customers to enter the information and estimate the cost of the shipment.
The company provides shipping services between Brazil, Ireland and United States. Transportation of goods can be by air, land, or sea. If the selected means of transport is air, an express service is offered for same-day shipping and delivery.
The data capture form to collect this specific information is as follows:
The earliest date (minimum value) a customer can request for a shipment is the current date. Use an expression to validate the given date.
1. Click on the Shipping Date control to display its Properties in the Left panel.
2. Select the Expression icon in the Minimum Date range property of the Advanced tab,
Click New to create a new expression.
3. In the new window, right click on the vertical line of the rule and add an expression module.
4. Type the following sentence and save the expression.
This expression will return today's date and assign it to the shipping date as a minimum value.
//Returns today date
5. Test the expression in the Work Portal. Notice that in the Shipping Date calender the days (and months) preceding the current date are disabled.
Keep in mind that the type of value returned in the expression must coincide with the type of value that the control manages (e.g dates with dates, integer with integer). If they are different, errors may occur in the execution of the form.