appendEmployeeSchedule2ByIDNum() Method

Table of Contents

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

Function

  • Add a schedule for a specific employee

Syntax

  • AeXMLBridge.appendEmployeeSchedule2ByIDNum(IDNum, AeSchedule2);

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
42
43
44
45
46
string empID = "1234";                                                     
// we will append to employee# 1234

TAeSchedule2 sched2 = new TAeSchedule2();

sched2.BenefitID = 0;
// since we are appending a Pay Designation schedule we set BenefitID to 0

TAeBasicDataItem[] payDes = ws.getPayDesignationsSimple();
// retrieve a list of Pay Designations and codes

sched2.PayDesID = payDes[0].Num;
sched2.SchDate = DateTime.Now.AddDays(7).ToString("yyyy-MM-dd");
// add the schedule 7 days from now

sched2.SchEndTime = "22:00";
sched2.schHours = 210;
// total time of hours in minutes

sched2.SchHoursHund = 3.5;
// convert SchHours to numerical representation

sched2.SchPattID = 0;
sched2.SchRate = 12.50;
// set employee rate for schedule

sched2.SchStartTime = "18:30";
sched2.SchStyle = 0;
sched2.SchType = TSchTypeEnum.steNormal;
// type of schedule followed

TAeEmployeeBasic emp = ws.getEmployeeBasicByIDNum(empID);
// retrieve workgroup information

sched2.SchWG1 = emp.WG1;
sched2.SchWG2 = emp.WG2;
sched2.SchWG3 = emp.WG3;

try
{
ws.appendEmployeeSchedule2ByIDNum(empID, sched2);
}
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
32
33
34
35
36
37
38
39
40
41
42
Dim empID As string = "1234"
' we will append to employee# 1234

Dim sched2 As New TAeSchedule2()
sched2.BenefitID = 0
' since we are appending a Pay Designation schedule we set BenefitID = 0

Dim payDes As TAeBasicDataItem() = ws.getPayDesignationsSimple()
' retrieve a list of Pay Designation Codes
sched2.PayDesID = payDes(0).Num

sched2.SchDate = DateTime.Now.AddDays(7).ToString("yyyy-MM-dd")
' append to 7 days in advance

sched2.SchEndTime = "22:00"
sched2.SchHours = 180
' 3 hours = 180 minutes

sched2.SchHoursHund = 3.0
' convert SchHours to numeric hours representation

sched2.SchPattID = 0
sched2.SchRate = 12.5
' set rate to 12.50 for this schedule

sched2.SchStartTime = "19:00"
sched2.SchStyle = 0
sched2.SchType = TSchTypeEnum.steNormal
' type of schedule we are following

Dim emp As TAeEmployeeBasic = ws.getEmployeeBasicByIDNum(empID)
' get Employee Basic information so we can use employee's workgroup

sched2.SchWG1 = emp.WG1
sched2.SchWG2 = emp.WG2
sched2.SchWG3 = emp.WG3

Try
ws.appendEmployeeSchedule2ByIDNum(empID, sched2)
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try

Remarks

Possible Errors

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

Alternate Methods

appendEmployeeSchedule2ByFilekey

extractEmployeePeriodShiftSchedulesByIDNum
extractEmployeeSchedules2ByIDNum
extractRangedSchedules2UsingHyperQuery
removeEmployeeScheduleByUniqueID
removeEmployeeSchedulesInRangeByIDNum

Back to Top