Important: In the XML for the Deduction Code field of these forms, you should include a <Filter>
tag with a list of deductions that users can select. If you don't include a <Filter>
tag, all available deductions will be available for users to select. More details are provided below.
In the XML for the Deduction Code field, define the one or more reference codes of the deductions that you want available in the form. In the example below, within the <Filter>
tag, the <FieldValue> tag (highlighted yellow) includes reference codes for two deductions; as a result, only the two corresponding deductions will be available to select in the form:
<Field>
<Style>VComboBox</Style>
<Block>1</Block>
<Row>4</Row>
<Column>0</Column>
<BindingProperty>EmployeeDeduction.PRDeductionXrefCode</BindingProperty>
<DataProvider>AllDeductions</DataProvider>
<DisplayMemberPath>ShortName</DisplayMemberPath>
<SelectedValuePath>XRefCode</SelectedValuePath>
<IsReadOnly>False</IsReadOnly>
<Visible>True</Visible>
<IsRequired>False</IsRequired>
<InitialValue>NULL</InitialValue>
<Filter>
<FieldName>XRefCode</FieldName>
<FieldValue>CharityDeduction;EventDeduction</FieldValue>
</Filter>
</Field>
In the following code examples, the <FieldValue> tag is empty so that you can add one or more reference codes of the deductions that you want to include:
You can also configure the form to only offer a specific single deduction by setting the Deduction Code field to that deduction and hiding it from editing. In this case, you should include a reference to the deduction in the form title and caption text as a helpful tip.
In the example below, the Deduction Code field is configured as follows:
- The
<Visible>
tag (highlighted yellow) is set to False so that the field isn't visible to users filling out the form. - The
<InitialValue>
tag (highlighted gray) includes the reference code of the deduction, so that it’s selected by default. - The <FieldValue> tag (highlighted blue) includes a reference code for the deduction.
<Field>
<Style>VComboBox</Style>
<Block>1</Block>
<Row>4</Row>
<Column>0</Column>
<BindingProperty>EmployeeDeduction.PRDeductionXrefCode</BindingProperty>
<DataProvider>AllDeductions</DataProvider>
<DisplayMemberPath>ShortName</DisplayMemberPath>
<SelectedValuePath>XRefCode</SelectedValuePath>
<IsReadOnly>False</IsReadOnly>
<Visible>True</Visible>
<IsRequired>False</IsRequired>
<InitialValue>CharityDeduction</InitialValue>
<Filter>
<FieldName>XRefCode</FieldName>
<FieldValue>CharityDeduction</FieldValue>
</Filter>
</Field>
You can also preset the value type in the Amount/Percent field of the form. See Amount or Percent Value.