The following is an example of code for a payroll election cancellation form.
Before You Begin: In this code, you need to define which specific deductions users can select. See Define Available Deductions.
Copy
<WF_DynamicForm>
<DataClass>Employee</DataClass>
<ValidationRule Event="OnSubmit" Type="PayrollEmployeeElectionValidationRule" />
<FormHeader>
<Style>header</Style>
<Title>Payroll Election Cancellation</Title>
</FormHeader>
<!-- Used Class for EmployeeEmploymentStatus -->
<UsedClass>
<Name>List_EmployeeEmploymentStatus</Name>
<Mode>Current</Mode>
<AddNewInstanceIfEmpty>true</AddNewInstanceIfEmpty>
<DefaultStatus>Insert</DefaultStatus>
</UsedClass>
<UsedClass>
<Name>EmployeeDeduction</Name>
<Mode>Current</Mode>
<AddNewInstanceIfEmpty>true</AddNewInstanceIfEmpty>
<DefaultStatus>Insert</DefaultStatus>
</UsedClass>
<EmployeeHeaderPanel>
<Style />
</EmployeeHeaderPanel>
<FormBody>
<Style>IVFormBody</Style>
<Block>
<Style />
<NumberOfColumns>4</NumberOfColumns>
</Block>
<Field>
<Style>IVCheckBox</Style>
<BindingProperty>EmployeeDeduction.DisableNewElection</BindingProperty>
<IsRequired>True</IsRequired>
<Visible>False</Visible>
<InitialValue>False</InitialValue>
</Field>
<!-- Row 1 -->
<Panel>
<Style>IVPanel</Style>
<Caption>Payroll Election Cancellation</Caption>
<Row>1</Row>
<Column>0</Column>
<ColumnSpan>4</ColumnSpan>
</Panel>
<!-- Row 2 -->
<Label>
<Style>InLineHelpLabel</Style>
<Caption>I authorize my voluntary withholding for the selected payroll election deduction to be discontinued as of the end date indicated.</Caption>
<MarkAsRequired>False</MarkAsRequired>
<Row>2</Row>
<Column>0</Column>
<ColumnSpan>4</ColumnSpan>
</Label>
<!-- Row 4: Deduction Code Label -->
<Label>
<Style>IVLabel</Style>
<Caption>lblDeductionCode</Caption>
<MarkAsRequired>True</MarkAsRequired>
<Row>4</Row>
<Column>0</Column>
<Visible>True</Visible>
</Label>
<!-- Row 4: End Date Label -->
<Label>
<Style>IVLabel</Style>
<Caption>lblEndDate</Caption>
<MarkAsRequired>True</MarkAsRequired>
<Row>4</Row>
<Column>1</Column>
<Visible>True</Visible>
</Label>
<!-- Row 4: Cancel Check Box Label -->
<Label>
<Style>IVLabel</Style>
<Caption>lblCancel</Caption>
<MarkAsRequired>False</MarkAsRequired>
<Row>4</Row>
<Column>2</Column>
<Visible>False</Visible>
</Label>
<!-- Row 5: Cancel Deduction Code Field -->
<Field>
<Style>VComboBox</Style>
<Block>1</Block>
<Row>5</Row>
<Column>0</Column>
<BindingProperty>EmployeeDeduction.CancelPRDeductionXrefCode</BindingProperty>
<DataProvider>AllDeductions</DataProvider>
<DisplayMemberPath>ShortName</DisplayMemberPath>
<SelectedValuePath>XRefCode</SelectedValuePath>
<IsReadOnly>False</IsReadOnly>
<IsRequired>True</IsRequired>
<InitialValue>NULL</InitialValue>
<Visible>True</Visible>
<Filter>
<FieldName>XRefCode</FieldName>
<FieldValue></FieldValue>
</Filter>
</Field>
<!-- Row 5: Cancel End Date Field -->
<Field>
<Style>IVDatePicker</Style>
<Block>1</Block>
<Row>5</Row>
<Column>1</Column>
<BindingProperty>EmployeeDeduction.CancelEffectiveEnd</BindingProperty>
<IsRequired>True</IsRequired>
<InitialValue>Function:now</InitialValue>
<Visible>True</Visible>
</Field>
<!-- Row 5: Cancel Checkbox -->
<Field>
<Style>IVCheckBox</Style>
<Row>5</Row>
<Column>2</Column>
<BindingProperty>EmployeeDeduction.IsCancel</BindingProperty>
<IsRequired>True</IsRequired>
<Visible>False</Visible>
<InitialValue>True</InitialValue>
<IsReadOnly>True</IsReadOnly>
</Field>
<!-- Row 7: end form line -->
<Panel>
<Style>IVPanel</Style>
<Caption>Please Note</Caption>
<Row>7</Row>
<Column>0</Column>
<ColumnSpan>4</ColumnSpan>
<Visible>True</Visible>
</Panel>
<!-- Row 8: Comment caption -->
<Label>
<Style>InLineHelpLabel</Style>
<Caption>Your payroll election cancellation request will be routed for approval. It may take several days for the request to be approved. Once the cancellation is approved, your election will be end dated as of the date indicated above. For questions, please contact your payroll department.</Caption>
<MarkAsRequired>False</MarkAsRequired>
<Row>8</Row>
<Column>0</Column>
<ColumnSpan>4</ColumnSpan>
</Label>
<!-- Row 9: Employee Comment -->
<SimpleComment>
<Caption>Comment</Caption>
<Row>9</Row>
<Column>0</Column>
<ColumnSpan>4</ColumnSpan>
<BindingProperty>EmployeeDeduction.EmployeeComment</BindingProperty>
</SimpleComment>
</FormBody>
</WF_DynamicForm>