transferEmployeeNowByIDNum() 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

  • Adds a workgroup transfer transaction to an employee’s time card

Syntax

  • AeXMLBridge.transferEmployeeNowByIDNum(IDNum, AeWorkgroupSet, Rate, ReasonCodeID);

Parameters

  • String - employee ID
  • Structure - TAeWorkgroupSet
  • Double - rate of pay (if unused, set to zero)
  • Integer - reason code ID (if unused, set to zero)

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
string empID = "1234";                                                         
// working with employee with ID 1234

double payRate = 0;
// not changing pay rate

TAeBasicDataItem[] reasons = ws.getReasonCodesSimple();
// retrieve list of Reason Code values
int reasonCodeID = reasons[0].Num;

string otherEmp = "4321";
// in this instance we are setting the new workgroup to that of employee 4321
TAeEmployeeBasic emp = ws.getEmployeeBasicByIDNum(otherEmp);

TAeWorkgroupSet wgSet = new TAeWorkgroupSet();
wgSet.WG1 = emp.WG1;
wgSet.WG2 = emp.WG2;
wgSet.WG3 = emp.WG3;
wgSet.WG4 = emp.WG4;
wgSet.WG5 = emp.WG5;
wgSet.WG6 = emp.WG6;
wgSet.WG7 = emp.WG7;

try
{
ws.transferEmployeeNowByIDNum(empID, wgSet, payRate, reasonCodeID);
}
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
im empID As String = "1234"
' working with employee with ID 1234

Dim payRate As Double = 0
' not changing pay rate

Dim reasons As TAeBasicDataItem() = ws.getReasonCodesSimple()
' retrieve list of Reason Code values
Dim reasonCodeID As Integer = reasons(0).Num

Dim filekey As Integer = 4321
' in this instance we are setting the new workgroup to that of employee 4321
Dim otherEmp As TAeEmployeeBasic = ws.getEmployeeBasicByIDNum(otherEmp)

Dim wgSet As New TAeWorkgroupSet()
wgSet.WG1 = emp.WG1
wgSet.WG2 = emp.WG2
wgSet.WG3 = emp.WG3
wgSet.WG4 = emp.WG4
wgSet.WG5 = emp.WG5
wgSet.WG6 = emp.WG6
wgSet.WG7 = emp.WG7

Try
ws.transferEmployeeNowByIDNum(empID, wgSet, payRate, reasonCodeID)
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try

Remarks

  • Use getReasonCodesSimple to retrieve a list of Reason Code values if needed
  • Applies workgroup transfer transaction to employee

Possible Errors

  • Unable to locate employee with identifier
  • Invalid Reason Code

Alternate Method

transferEmployeeNowByFilekey

addEmployeeTransferRate
appendEmployeeTransferByIDNum
getEmployeeTransferRate
getEmployeeTransferRatesByIDNum
removeEmployeeTransferRate
updateEmployeeTransferRate

Back to Top