appendEmployeeTransferByFilekey() Method

Table of Contents

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

Function

  • Adds a new workgroup for an employee during the current or next pay period

Syntax

  • AeXMLBridge.appendEmployeeTransferByFilekey(filekey, timestamp, AeWorkgroupSet, Rate, ReasonCode);

Parameters

  • Integer - employee filekey
  • 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 skip)

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
35
36

int filekey = 1234;
// appending transfer for employee# 1234

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

int newFilekey = 2345;

TAeEmployeeBasic newEmp = ws.getEmployeeBasicByFilekey(newFilekey);
// transferring employee into same workgroup as employee# 2345

TAeWorkgroupSet wgSet = new TAeWorkgroupSet();
// set the workgroup levels

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

double rate = 0.0;
// setting rate to zero means we will use the workgroup rate

int reasonID = 0;

try
{
ws.appendEmployeeTransferByFilekey(filekey, ts, wgSet, rate, reasonID);
}
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
24
25
26
27
28
29
30
31

Dim filekey As Integer = 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.appendEmployeeTransferByFilekey(filekey, ts, wgSet, rate, reasonID)
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try

Remarks

  • Use getReasonCodesSimple to obtain a reasonID if needed
  • Can set workgroups to an existing employee or pull the values from the database

Possible Errors

  • No such employee with Filekey
  • yyyy-mm-dd is required [Date supplied in invalid format]

Preferred Method

appendEmployeeTransferByIDNum

addEmployeeTransferRate
getEmployeeTransferRate
getEmployeeTransferRatesByIDNum
removeEmployeeTransferRate
transferEmployeeNowByIDNum
updateEmployeeTransferRate

Back to Top