Code Example: Update Earnings Form (Grid)

XML Forms Guide

Version
R2024.1.1
Code Example: Update Earnings Form (Grid)

The following is an example of code for an update earnings form with a grid. The form can be used to request new earnings or change the scheduled amount of existing earnings.

Before You Begin: In this code, you need to define which specific earnings users can select. See Define Available Earnings.

Copy
<WF_DynamicForm>
    <DataClass>Employee</DataClass>
    <FormHeader>
        <Style>header</Style>
        <Title>Update Employee Earnings</Title>
    </FormHeader>
    <!-- Used Class for EmployeeEarning-->
    <UsedClass>
        <Name>List_EmployeeEarning</Name>
        <Mode>Current</Mode>
        <AddNewInstanceIfEmpty>true</AddNewInstanceIfEmpty>
        <DefaultStatus>Insert</DefaultStatus>
    </UsedClass>
    <EmployeeHeaderPanel>
        <Style />
    </EmployeeHeaderPanel>
    <FormBody>
        <Style>IVFormBody</Style>
        <Block>
            <Style />
            <NumberOfColumns>6</NumberOfColumns>
        </Block>
        <Panel>
            <Style>IVPanel</Style>
            <Caption>Employee Earnings</Caption>
            <Row>0</Row>
        </Panel>
        <Label>
            <Style>InLineHelpLabel</Style>
            <Block>1</Block>
            <Row>1</Row>
            <Column>0</Column>
            <ColumnSpan>6</ColumnSpan>
            <Caption>Add, update or remove Employee Earnings via the corresponding rows in the grid. The Forms - Employee Earnings Access Authorisation must be granted to access the corresponding data.</Caption>
            <MarkAsRequired>false</MarkAsRequired>
        </Label>
        <Grid>
            <Style />
            <Block>1</Block>
            <Row>7</Row>
            <Column>0</Column>
            <RowSpan>4</RowSpan>
            <ItemSource>List_EmployeeEarning</ItemSource>
            <AuthorizationKey>HRMS_CONTACT</AuthorizationKey>
            <GridColumn>
                <BindingProperty>PREarningId</BindingProperty>
                <DataProvider>PREarnings</DataProvider>
                <HeaderCaption>PR Earning</HeaderCaption>
                <DisplayMemberPath>Shortname</DisplayMemberPath>
                <SelectedValuePath>Id</SelectedValuePath>
            </GridColumn>
            <GridColumn>
                <BindingProperty>EffectiveStart</BindingProperty>
                <HeaderCaption>Start Date</HeaderCaption>
                <IsRequired>true</IsRequired>
            </GridColumn>
            <GridColumn>
                <BindingProperty>EffectiveEnd</BindingProperty>
                <HeaderCaption>End Date</HeaderCaption>
            </GridColumn>
            <GridColumn>
                <BindingProperty>LimitAmount</BindingProperty>
                <HeaderCaption>Limit Amount</HeaderCaption>
                <IsRequired>true</IsRequired>
            </GridColumn>
            <GridColumn>
                <BindingProperty>PREarnDeductScheduleId</BindingProperty>
                <DataProvider>VisiblePREarnDeductSchedules</DataProvider>
                <HeaderCaption>PR Earn Deduct Schedule</HeaderCaption>
                <DisplayMemberPath>Shortname</DisplayMemberPath>
                <SelectedValuePath>Id</SelectedValuePath>
            </GridColumn>
        </Grid>
    </FormBody>
</WF_DynamicForm>