appendEmployeeTransferByIDNum 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

  • Add a workgroup transfer transaction to an employee’s time card for the current or previous pay period

Syntax

  • AeXMLBridge.appendEmployeeTransferByIDNum(IDNum, TimeStamp, AeWorkgroupSet, Rate, ReasonCodeID);

Parameters

  • String - employee ID
  • String - current timestamp (yyyy-mm-dd HH:mm:ss.fff format)
  • Structure - TAeWorkgroupSet
  • Double - rate of pay (Optional - set to zero to use new workgroup rate)
  • Integer - reason code ID (Optional - set to zero to omit)

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
26
27
28
29
30
31
32
33
34
string empID = "1234";                                                    
// we are appending to employee "1234"

string ts = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff");
// formatted timestamp

TAeEmployeeBasic empInfo = ws.getEmployeeBasicByIDNum("2345");
// using same workgroup as employee "2345"

TAeWorkgroupSet wgSet = new TAeWorkgroupSet();

wgSet.WG1 = empInfo.WG1; wgSet.WG2 = empInfo.WG2;
wgSet.WG3 = empInfo.WG3;
wgSet.WG4 = empInfo.WG4;
wgSet.WG5 = empInfo.WG5;
wgSet.WG6 = empInfo.WG6;
wgSet.WG7 = empInfo.WG7;

double rate = 15.00;
// set new rate to $15.00

TAeBasicDateItem reasons = ws.getReasonCodesSimple();
// retrieve a list of reason codes

int reasonID = reasons[0].Num;

try
{
ws.appendEmployeeTransferByIDNum(empID, ts, wgSet, rate, reasonID);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}

Sample Code 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
24
25
26
27
28
29
30
Dim empID as String = "1234"
' appending transfer for employee# 1234

Dim ts As String = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff")
' formatted timestamp

Dim newFilekey As Integer = 2345
Dim newEmp As TAeEmployeeBasic = ws.getEmployeeBasicByFilekey(newFilekey)
' transferring employee into same workgroup as employee# 2345

Dim wgSet As New TAeWorkgroupSet()
wgSet.WG1 = newEmp.WG1
' set the workgroup levels
wgSet.WG2 = newEmp.WG2
wgSet.WG3 = newEmp.WG3
wgSet.WG4 = newEmp.WG4
wgSet.WG5 = newEmp.WG5
wgSet.WG6 = newEmp.WG6
wgSet.WG7 = newEmp.WG7

Dim rate As Double = 0.0
' setting rate to zero means we will use the workgroup rate

Dim reasonID As Integer = 0

Try
ws.appendEmployeeTransferByIDNum(empID, ts, wgSet, rate, reasonID)
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try

Remarks

  • Use getReasonCodesSimple to retrieve a list of reason codes
  • an set workgroups to an existing employee or pull the values from the database

Possible Errors

  • Employee with ID not found
  • yyyy-mm-dd is required [Date supplied in invalid format]

Alternate Method

appendEmployeeTransferByFilekey

addEmployeeTransferRate
getEmployeeTransferRate
getEmployeeTransferRatesByIDNum
removeEmployeeTransferRate
transferEmployeeNowByIDNum
updateEmployeeTransferRate

Back to Top