Application Note - Defaulting Date Fields
Manager Contents
User Contents


Introduction

It is often desirable to default date fields to a relative date in the future (e.g. 4 days from the current date). Date tokens may be used to accomplish this, just as they may be used in Queries. Date ranges are not applicable, since default values are single values. This application note demonstrates an alternative method of defaulting date values via Calculated Parameter Data Links.

Implementation

Step 1 - Create a Calculated Data Link

From the Connectivity and Escalation section of the Manage page, select Data Links. Add a new calculated data link. In the Add New Calculated Data Link dialog, enter the following information:

Data Link Name: "Date 4 Days From Now"
Parameter 1: "Calculated Date"
Parameter 2: "4"

Submit the data link. Your data link name will be automatically enclosed in "[]" characters, to designate it as a user-defined Data Link. In the steps that follow, the data link will be referred to as "[Date 4 Days From Now]".

Step 2 - Specify the Data Link as the Default

Access the Field Definition Edit page for the date field to be defaulted. To do this:

  • Select the appropriate type of category listings from the Manage page (Issue Categories, Action Categories, etc.).
  • Click the Field Definitions button for the appropriate category.
  • Click the caption of the date field to be defaulted.

In the Default Value field, enter "![Date 4 Days From Now]". Be sure to include the exclamation point. Submit the field definition.

Step 3 - Verifying the Change

In the Field Definitions list, scroll down to the sample form. The date field should now show a date 4 days from the current date.

Notes

Note that if you elect to edit the "Date 4 Days From Now" data link, changes made in the data link will not automatically be reflected in the field definitions that use the data link. For example, if you were to change the Parameter2 entry from "4" to "6", the fields would still default to a date 4 days in the future, not 6 days in the future. To have the change take effect, the field definitions using the data link must again be edited and saved. This behavior is by design, as the system has been deliberately denormalized in this area to provide maximum performance (minimum form load time) for the users.