adjustEmployeeBenefitBalanceByIDNum() Method

Table of Contents

  1. Function
  2. Syntax
  3. Parameters
  4. Return Value
  5. Sample Code
  6. Remarks
  7. Possible Errors
  8. Alternate Method
  9. Related Methods

Function

  • Set, credit or debit an employee’s benefit balance on a specified date

Syntax

  • AeXMLBridge.adjustEmployeeBenefitBalanceByIDNum(IDNum, BenefitID, EffectiveDate, BenAdjType, Amount);

Parameters

  • String - employee ID
  • Integer - selected benefit ID
  • String - date the adjustment becomes effective (yyyy-MM-dd format)
  • Enumeration - TBenAdjTypeEnum
  • Double - amount of the adjustment (in hours)

Return Value

  • None

Sample Code

C#

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
TAeBasicDataItem[] benefits = ws.getBenefitsSimple();                     
// returns list of benefits - names and numbers

int benefitID = benefits[0].Num;
// select the benefit we want to adjust

int empID = "1234";
// using employee "1234"

TBenAdjTypeEnum adjType = TBenAdjTypeEnum.batCredit;
// we are going to credit the benefit balance
double hours = 20.0d;
// by crediting 20 hours

string selDate = ws.dateRangeEnumStartDate(TDateRangeEnum.drCurrPeriod);
// retrieve the beginning date of the current period

try
{
ws.adjustEmployeeBenefitBalanceByIDNum(empID, benefitID, selDate, adjType, hours);
}
catch(Exception ex)
{
MessageBox.Show(ex.Message);
}

VB.Net

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
Dim benefits As TAeBasicDataItem() = ws.getBenefitsSimple()
' returns list of benefits - names and numbers

Dim benefitID As Integer = benefits(0).Num
' select the benefit we want to adjust

Dim empID As Integer = "1234"
' using employee "1234"

Dim adjType As TBenAdjTypeEnum = TBenAdjTypeEnum.batCredit
' we are going to credit the benefit balance

Dim hours As Double = 20.0
' by crediting 20 hours

Dim selDate As String = ws.dateRangeEnumStartDate(TDateRangeEnum.drCurrPeriod)
' retrieve the beginning date of the current period

Try
ws.adjustEmployeeBenefitBalanceByIDNum(empID, benefitID, selDate, adjType, hours)
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try

Remarks

  • A list of benefitID can be obtained using the getBenefitsSimple method.
  • Be aware of your current system date if you are using this method on a database in demo mode.
  • Effective dates should be set to the beginning or ending of a pay period. Effective dates in the middle of a pay period can conflict with benefits used within the gaps.

Possible Errors

  • Unable to locate employee identifier
  • yyyy-mm-dd is required [Date supplied in invalid format]

Alternate Method

adjustEmployeeBenefitBalanceByFilekey

employeeBenefitBalanceAsOfByIDNum
extractEmployeeBenefitActivityByIDNum
extractEmployeeBenefitBalancesAsOfUsingHyperQuery
getCorrectiveActionsSimple
getEmployeeBenefitBalancesAsOfByIDNum
recomputeEmployeeAccrualsByIDNum
removeEmployeeBenefitAdjustmentsByIDNum

Back to Top