addEmployeeTransferRate() Method

Table of Contents

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

Function

  • Adds a new transfer rate for the selected employee

Syntax

  • AeXMLBridge.addEmployeeTransferRate(AeEmpTranRate);

Parameters

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
37
38
39
40
41
TAeEmployeeBasic[] emps = ws.getActiveEmployeesList();               
// return an array of active employees

TAeEmpTranRate etr = new TAeEmpTranRate();

etr.EffDate = DateTime.Now.AddDays(7).ToString(“yyyy-MM-dd”);
// set date to 7 days from now and format it

etr.EmpID = emps[0].EmpID;
etr.Filekey = emps[0].Filekey;
etr.Flags = 1;
// type of rate multiplier

etr.Modified = DateTime.Now.ToString(“yyyy-MM-dd”);
// set to today and format it

etr.Rate = 20.00d;

TAeAccessAccount acct = ws.getCurrentAccessAccount();
// retrieve our current access account to get the account code

TAeWorkgroupSet[] wgSets = ws.getAccessAccountWorkgroupAccessRightsByAccountCode(acct.AccountCode);
// retrieve workgroup values to transfer to

etr.WG1 = wgSets[0].WG1;
etr.WG2 = wgSets[0].WG2;
etr.WG3 = wgSets[0].WG3;
etr.WG4 = wgSets[0].WG4;
etr.WG5 = wgSets[0].WG5;
etr.WG6 = wgSets[0].WG6;
etr.WG7 = wgSets[0].WG7;

try
{
ws.addEmployeeTransferRate(etr);
}
catch(Exception ex)
{
MessageBox.Show(ex.Message);
}
Sample Code - VB.Net

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
32
33
34
35
36
37
38
Dim emps As TAeEmployeeBasic() = ws.getActiveEmployeesList()
' return an array of active employees

Dim etr As New TAeEmpTranRate()

etr.EffDate = DateTime.Now.AddDays(7).ToString("yyyy-MM-dd")
' set date to 7 days from now and format it

etr.EmpID = emps(0).EmpID
etr.Filekey = emps(0).Filekey

etr.Flags = 1
' type of rate multiplier

etr.Modified = DateTime.Now.ToString("yyyy-MM-dd")
' set to today and format it

etr.Rate = 20.0

Dim acct As TAeAccessAccount = ws.getCurrentAccessAccount()
' retrieve our current access account to get the account code

Dim wgSets As TAeWorkgroupSet() = ws.getAccessAccountWorkgroupAccessRightsByAccountCode(acct.AccountCode)
' retrieve workgroup values to transfer to

etr.WG1 = wgSets(0).WG1
etr.WG2 = wgSets(0).WG2
etr.WG3 = wgSets(0).WG3
etr.WG4 = wgSets(0).WG4
etr.WG5 = wgSets(0).WG5
etr.WG6 = wgSets(0).WG6
etr.WG7 = wgSets(0).WG7

Try
ws.addEmployeeTransferRate(etr)
Catch ex as Exception
MessageBox.Show(ex.Message)
End Try

Remarks

Possible Errors

  • Employee with filekey not found
  • yyyy-mm-dd required (Date supplied in invalid format)

addEmployeeTransferRate
appendEmployeeTransferByIDNum
getEmployeeTransferRate
getEmployeeTransferRatesByIDNum
removeEmployeeTransferRate
transferEmployeeNowBYIDNum
updateEmployeeTransferRate
Back to Top