This topic discusses how to use a calculation data item to set the due date of a task based on the time the task is assigned. The calculation data item uses date functions to determine that due date.
You can use an expression editor field in place of the calculation data item, but using a calculation data item has the following advantages:
- Reuse the same calculation data item with multiple assignment profiles and activities.
- Save time by updating the calculation data item once when your requirements change (instead of having to update each expression editor field that uses the expression).
- Calculation data items are validated when you publish a solution. Expression editor fields are not.
To calculate a dynamic due date based on the time a task is assigned, complete the following steps:
- Check out the solution that you want to edit.
- Click the Create tab. The Solution Items ribbon menu is displayed.
- Click New Data item. The Manage Solution Data Items tab is displayed in the workspace.
- In the Name column of the new row, type a name for the data item. The default name is changed.
Note: |
The Rule Engine does not support hyphens in field names. |
- In the Data Item type column of the new row, click the drop-down arrow. A drop-down list is displayed.
- Select Calculation Data. The selected option is displayed in the Data Item Type column.
Note: |
Calculation data items are read-only. You cannot edit this type of data item. |
- In the Properties tab, click the Edit tab. The Expression Editor window is displayed.
- In the Expression Builder field enter the calculation for your requirements that results in a date and time being returned. Bluespring recommends using the following date functions to set the due date of a task:
- AddDays
- AddHours
- AddMinutes
- AddMonths
- Now
Example: |
If your business requirement is to assign a task due on the next day, use the AddDays function. Specifically, set the expression to as follows: AddDays(Now(), 1) |
- Click OK. The expression is displayed in the Expression field.
- Check out and view the assignment profile with which you want to use this date calculation.
- Click the Due Date tab.
- Select the Due Date check box. The Due Date fields are enabled.
- Select Due on. The Due on field is enabled.
- In the Due on field, select Data Item editor.
- Click the Data Item editor and a drop-down list is displayed.
- Click the data item that you created in the steps above.
- Click the save button. Tasks that use this assignment profile will now be due based on the date that is calculated when the task is assigned.