appendEmployeeScheduleByIDNum() 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. Alternate Method
  10. Related Methods

Function

  • Add a schedule for a specific employee

Syntax

  • AeXMLBridge.appendEmployeeScheduleByIDNum(IDNum, TAeSchedule);

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"

TAeSchedule sched = new TAeSchedule();

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

TAeBasicDataItem[] payDes = ws.getPayDesignationsSimple();
// retrieve a list of Pay Designation Codes

sched.PayDesID = payDes[0].Num;
sched.SchDate = DateTime.Now.AddDays(7).ToString("yyyy-MM-dd");
// set date of schedule to one week from now

sched.SchEndTime = "22:00";
sched.SchHours = 180;
// 3 hours = 180 minutes

sched.SchHoursHund = 3.0;
// numerical representation of SchHours

sched.PattID = 0;
sched.SchRate = 15.00;
// set pay rate for this schedule to $15

sched.SchStartTime = "19:00";
sched.SchStyle = 0;
sched.SchType = TSchTypeEnum.steNormal;

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

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

try
{
ws.appendEmployeeScheduleByIDNum(empID, sched);
}
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 sched As New TAeSchedule()
sched.BenefitID = 0
' set BenefitID = 0 since we are appending a Pay Designation schedule

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

sched.SchDate = DateTime.Now.AddDays(7).ToString("yyyy-MM-dd")
' set schedule date to 7 days from now

sched.SchEndTime = "22:30"
sched.SchHours = 210
' 3 1/2 hours = 210 minutes

sched.SchHoursHund = 3.5
' numerical representation of hours

sched.PattID = 0
sched.SchRate = 15.0
' set rate for this schedule to $15

sched.SchStartTime = "19:00"
sched.SchStyle = 0
sched.SchType = TSchTypeEnum.steNormal

Dim emp As TAeEmployeeBasic = ws.getEmployeeBasicByIDNum(empID)
' retrieve employee basic information so we can use their workgroups

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

Try
ws.appendEmployeeScheduleByIDNum(empID, sched)
Catch
MessageBox.Show(ex.Message)
End Try

Remarks

Possible Errors

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

Preferred Method

appendEmployeeSchedule2ByIDNum

Alternate Method

appendEmployeeScheduleByFilekey

extractEmployeePeriodShiftSchedulesByIDNum
extractEmployeeSchedules2ByIDNum
extractRangedSchedules2UsingHyperQuery
removeEmployeeScheduleByUniqueID
removeEmployeeSchedulesInRangeByIDNum

Back to Top