In Workflow Administration > Form Builder, you can configure forward forms, which are a type of form that evaluates a set of conditions so that it can display the appropriate form content to an employee.
An example of a forward form is the system Province/State Tax form. When an employee opens this form, the application checks which country and then which state or province the employee works in and displays the appropriate form to fill out.
You can use forward forms to reduce the number of role privilege/form pairings that you need to configure in Workflow Administration > Role Privileges. Instead of configuring multiple role privilege/form pairings, you can configure a single forward form that launches the appropriate form content for the employee.
Forward forms are only supported for forms with Edit selected in the Mode drop-down list of the Properties tab in Workflow Administration > Form Builder. These are forms that impact existing employees like tax forms or the Job Assignment and Compensation Change form. Forward forms aren’t supported for forms with New selected in the Mode drop-down list, because these forms don’t impact existing employees. For example, the New Hire form has no employee record for the application to check.
Custom forward forms:
- Start with the
<WF_ForwardForm>
tag. - Include one or more case statements to determine which form content to display. If multiple case statements are configured, the application treats them as OR clauses. If the first case statement doesn’t evaluate to true, the next statement is executed.
- Case statements start with a
<Case>
tag with aDecisionField
attribute where you can set which field to evaluate. - Note: For a list of fields that can be evaluated, see Supported Fields for Forward Forms.
- Under
<Case>
tags, you need to add<When>
tags with aDecisionValue
attribute to identify which field value to evaluate. For example, if the form is evaluating the employee's pay type, you would enter the reference code of the pay type that you want the application to check for. - The
<When>
tag also includes aForm
attribute to set which form gets loaded for employees who meet the condition. In this attribute, you need to enter the reference code of the form that you want to launch. - At the end of the case statement, you should include a
<Default>
tag with aForm
attribute that sets which form is loaded if the employee doesn’t meet the conditions of the case statement. If you don't specify a default, and an employee doesn't meet any of the conditions set in the case statement, a message is displayed indicating that no form is available.
Note: Values entered in the XML code are case sensitive.
The following is an example of XML code for a simple forward form:
<WF_ForwardForm>
<Case DecisionField="PrimaryLegalEntity">
<When DecisionValue="CompanyXYZ" Form="TestForm1" />
<When DecisionValue="CompanyABC" Form="TestForm2" />
<Default Form="TestFormDefault" />
</Case>
</WF_ForwardForm>
In the preceding example, the form evaluates the legal entity of the employee's primary work assignment. When an employee opens this form, and they have a primary legal entity with the reference code CompanyXYZ or CompanyABC, the application displays forms with the reference code TestForm1 or TestForm2, respectively. If an employee is in neither of these legal entities, the application displays the default form with the reference code TestFormDefault.
You can also nest case statements within other case statements in a forward form, so that the application only evaluates the nested case if the parent case is true.
For example:
<WF_ForwardForm>
<Case DecisionField="PrimaryResidenceCountry">
<When DecisionValue="USA">
<Case DecisionField="TaxWorkLocationState">
<When DecisionValue="CA" Form="TestFormCA" />
<When DecisionValue="NY" Form="TestFormUS" />
<Default Form="TestFormUSA" />
</Case>
</When>
<When DecisionValue="CAN">
<Case DecisionField="TaxWorkLocationState">
<When DecisionValue="ON" Form="TestFormON" />
<When DecisionValue="QC" Form="TestFormQC" />
<Default Form="TestFormCAN" />
</Case>
</When>
<Default Form="TestFormDefault" />
</Case>
</WF_ForwardForm>
In the preceding example, the application performs the following process to launch the appropriate form:
- It first checks if the employee's primary residence address is in the United States, and if so it checks whether their work location state is in California or New York. If neither state is the work location state, the default form with the reference code
TestFormUSA
is displayed. - If the employee's primary residence isn’t in the United States, the application then checks if it’s in Canada. If so, it goes on to check whether their work location is in Ontario or Quebec. If neither province is the work location province, the default form with the reference code
TestFormCAN
is displayed. - If the employee's primary residence isn’t in the United States or Canada, the
TestFormDefault
form is displayed, as set in the<Default>
tag in the third last line of the code.