Open the eForm Controls tab of form definition for the Travel Expenses Request 2 that you created earlier. As was the case when we were editing the template using Word, we want to be sure that we’re saving our work frequently as we go along. When working with field properties, the do so by clicking the Update button on the bottom of the page.
Once you have opened the eForm Controls tab, click the Edit link for the AirFare field to open the properties dialog box.
In the properties dialog box, set the following properties"
- Check the Event Field check box.
- Set the ToolTip property to “Enter the Air Fare here”.
- Change the Friendly Name to “Air Fare”.
- Change the Data Type to "Currency". We want the user to report their air fare in dollars and cents (or whatever their local currency is); selecting “Currency” ensures that the data the user cannot submit the form unless the entered value is in that format (for example, “32.95”) and not some other (for example, “giraffes!”).
Click the OK button to close the dialog box. Now, open the ApprovalComments properties.
- Set both the ToolTip property to "Enter approver's comments".
- Set the Friendly Name property to “Approver's Comments”.
When finished, click the OK button to close and save the properties you’ve set.
Now, open the properties for the ApprovalCommentsSection, the Section control that houses the approver’s comments. We want to set the properties that will allow us to hide the approver’s comments when the form is opened by the initial user. Only approvers need to see this section of the form, so we are going to hide it when the form is initially created.
Select “Field is Hidden When…” from the Set Display Options dropdown. Selecting this property will add two items on the right side of the dropdown. One item is a text link that is labeled “Click to create condition…”. The other item is a check box labeled “Otherwise visible”. These are the properties that will control the section’s visibility.
Click on the text link that is labeled “Click to create condition…” to open the Conditions For dialog box, where we will add the conditions must apply to make this section of the form visible.
Click the Add Condition button to add a condition section to the dialog box. The first control in the condition is a picker control that will most likely have “Form Field” displayed in the textbox portion of the control. We need to change this, so click on the picker control’s Build button to open the Choose System Variable dialog box.
At the top of the dialog box is a dropdown menu that is labeled “Form Field”. Click on this dropdown menu and select Form >> New Form Instance? as shown in Figure 60: Choose System Variable for New Form below.
This will instruct Process Director to check if the form is being created for the first time. Click the OK button to close the Choose System Variable dialog box, which will return you to the Conditions dialog box for the control.
The picker control for the condition should now be labeled “New Form Instance?”. Set the remainder of the condition to “=” and “Yes” using the dropdown controls, so that the final condition looks like the condition shown in Figure 61: Condition Properties Setting, below.
Once you have set the condition settings, click the OK button to close the dialog box to return to the Properties dialog box for the ApprovalCommentsSection. Click the OK button to save and close the properties dialog box.
Open the properties for the Approver field.
- Set the ToolTip property to “Select the approver for first level of approval”.
- Change the Set Required Options dropdown to “Field is Required”. Making this field required will ensure that the user can’t submit the form without first selecting an approver.
Open the properties for the CarRental field, and check the Event Field check box.
- Set the ToolTip to "Enter the car rental amount".
- Set the Friendly Name property to "Car Rental".
- Set the Data Type dropdown control to “Currency”.
Open the properties for the ConditionalJustification field.
- Set the ToolTip to “Conditional Justification”.
- Change the Set Display Options dropdown value to “Field is Visible When…”.
We are going to need to set a condition for visibility, just as we did for the ApprovalCommentsSection. In this case, we will set a form field value to make this control visible if the total expense amount exceeds $1,000. Click the text link next to the Set Display Options dropdown that is labeled “Click to create condition…” to open the Conditions For dialog box.
In the Conditions For dialog box, click the Add Condition button to display a condition box. Click on the Build button to display the Choose System Variable dialog box. The dialog box is already set to “Form Field”, so, from the dropdown control labeled “[Select Form Field]”, select “ExpensesTotal”, and then click the OK button to return to the Conditions For dialog box.
In the Conditions For dialog box, set the operator to “>”, the Field Type to “Number”, then enter “1000” into the textbox. Your condition should look like Figure 65: ConditionalJustification Condition below.
Click the OK button to save the condition and return to the Form Field Properties dialog box.
Check the Otherwise Hidden check box to ensure the control is hidden unless the condition is true. Click the OK button to close the dialog box and save the properties.
Next, open the properties for the ExpenseDate field. Set the following properties:
- Set the ToolTip property to “Select the date from the calendar”.
- Set the Friendly Name to “Expense Date”.
- Change the Set Required Options dropdown control to “Field is Required”, as this is one of the expense fields we want to be sure the user fills out.
The ExpensesList control is the Array that will display each row of the daily expense estimate on the form. By default, the Array will start out empty. Of course, there will always be at least one row for the expense request, so we need to ensure that when the report opens, there will be one row displayed and ready to be filled out. So, set the Default Value type to “Number”, and the value to “1”.
Open the properties for the Justification field. Set the ToolTip to “Justification is required when the total amount is greater than $1,000”. We’ve already set the visibility condition for the Section that contains this control, so this control will only be visible when that section is visible: remember, properties like visibility are inherited.
Open the Lodging field properties and check the Event Field check box.
Open the properties for the Routing field. The Routing field is another Section control, like the ApprovalCommentsSection, that we don’t want to display when the form is opened by the initial user. Set the display condition for this field just as you did with the ApprovalCommentsSection field, so that the field is hidden if the form opens as a new form instance.
The SequenceNumber field is the first of the four standard controls discussed earlier. To set up the sequence number, open the SequenceNumber field properties.
- Set the Default Value to “Sequence Number”.
- Since we don’t want users to overwrite or change the Sequence Number, set the Set Readonly Options to “Field is Disabled”.
The SubmissionDate field, just like the SequenceNumber, is a field that should be a standard field on any form. It should also be a read-only field that is populated automatically by Process Director. Open the SubmissionDate field’s properties.
- Set the default value by selecting Form >> Form Submit Date from the Default Value menu.
- Set the Set Readonly Options to “Field is Disabled”.
The third and final standard field that will be both read-only, and automatically populated by Process Director, is the Submitter field.
- Set the default value by selecting Form >> Form Submit User from the Default Value dropdown menu.
- Set the Set Readonly Options to “Field is Disabled”.
Once you’ve set the Submitter properties, you’re done with setting the form field properties for now. We will need to return to the properties in a little bit to set the values that appear in the eForm’s dropdown controls for the Charge Number and the Reason for Travel.