maintainEmployeeBasic() 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 new employee or update an existing one with basic level information

Syntax

  • MaintainEmployeeResult = AeXMLBridge.maintainEmployeeBasic(AeEmployeeBasic, AddEmpMode, BadgeManagement);

Parameters

Return Value

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
TAeEmployeeBasic empBasic = new TAeEmployeeBasic();                       
// adding a new employee

empBasic.DateOfHire = DateTime.Now.ToString(“yyyy-MM-dd”);
// setting hire date to today
empBasic.EmpID = “1234”;
// setting employee id to “1234”
empBasic.FirstName = “James”;
empBasic.LastName = “Jones”;
// setting FirstName and LastName will generate EmpName field

TAddEmpMode addEmpMode = TAddEmpMode.aemAdd;
// adding a new record
TBadgeManagement badgeManagement = TBadgeManagement.bmAuto;
// generate a badge number when set to bmAuto

try
{
TMaintainEmployeeResult res = ws.maintainEmployeeBasic(empBasic, addEmpMode, badgeManagement);
}
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
Dim empBasic As New TAeEmployeeBasic()
‘ adding a new employee

empBasic.DateOfHire = DateTime.Now.ToString(“yyyy-MM-dd”)
‘ setting hire date to today

empBasic.EmpID = “1234
‘ setting employee id to1234

empBasic.FirstName = “James”
‘ setting FirstName and LastName will generate EmpName field
empBasic.LastName = “Jones”

Dim addEmpMode As TAddEmpMode = TAddEmpMode.aemAdd
‘ adding a new record

Dim badgeManagement As TBadgeManagement = TBadgeManagement.bmAuto
‘ generate a badge number when set to bmAuto

Try
Dim res As TMaintainEmployeeResult = ws.maintainEmployeeBasic(empBasic, addEmpMode, badgeManagement)
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try

Remarks

  • When doing an Add, and you know the name of the employee, you must enter both the FirstName and LastName fields. The EmpName field will be generated by concatenating the FirstName and LastName fields.

  • If the EmpID field is populated and does not represent an ID of an existing employee, an add employee operation is assumed. If the EmpID or Filekey fields are populated and represent an existing employee, an edit operation is assumed

  • When doing an add, EmpID is mandatory

  • When doing an add, a Badge number will be generated if the TBadgeManagement value is set to bmAuto

  • If an add operation is intended, all fields should be populated. If an edit operation is intended, only those fields that require change need be populated

  • It is quite basic in nature, and should be used only when the fields present in the TAeEmployeeDetail structure are not required for the integration project

  • For new employee records, initial default values are created for HourlyStatus, Workgroup and CurrentRate. In an immediate follow-up action, these values are replaced with the value you send in the employee object. In most cases, this has no effect. However, if you use an effective date in the past, the initial default value will override your sent value because the initlal value has a later effective date. You must either remove this initial value or send an update with a later date.

Possible Errors

  • When TMaintainEmployeeResult returns merBadParam, the record did not update because of one of the fields in the TAeEmployeeBasic structure was bad or invalid. Make sure all values in the structure are the correct data types and within the accepted value ranges

  • When doing an add, Employee ID cannot be blank

  • Invalid date format entered (must be yyyy-mm-dd format)

Preferred Method

maintainEmployeeDetail2

Alternate Method

maintainEmployeeDetail

getEmployeeBasicByIDNum
getEmployeeDetailByIDNum
setEmployeeBasic
setEmployeeDetail2
setEmployeeESSEmailByIDNum
setEmployeeESSPINByIDNum
setEmployeeTZByIDNum
setManuallySelectedEmployeeData

Back to Top