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

  • Add a new employee or update an existing one with detail2 level information

Syntax

  • MaintainEmployeeResult = AeXMLBridge.maintainEmployeeDetail2(AeEmployeeDetail2, 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
25
26
27
28
29
30
string empID = "1234";                                                    
// we are using employee with ID "1234" and are going to add

TAeEmployeeDetail2 empDetail2 = ws.getEmployeeDetail2ByIDNum(empID);
empDetail2.FirstName = "John";
empDetail2.Address1 = "1234 Main";
empDetail2.EMAIL = "myname@gmail.com";
empDetail2.ESSPIN = "1234";
empDetail2.ObservesDST = true;
empDetail2.EmpID = empID;
empDetail2.ActiveStatus = 0;
empDetail2.ActiveStatusCondition = 1;
// note these are not all of the fields in the structure. you can
// update any or all fields, as well as those included in the base structures


TAddEmpMode addEmpMode = TAddEmpMode.aemAuto;
// setting this to auto will force the method to see if an employee
// with the EmpID already exists

TBadgeManagement badgeManagement = TBadgeManagement.bmAuto;

try
{
TMaintainEmployeeResult res = ws.maintainEmployeeDetail2(empDetail2, 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
25
26
27
Dim empID As String = "1234"
' we are using employee with ID "1234" and are going to update

Dim empDetail2 As TAeEmployeeDetail2 = ws.getEmployeeDetail2ByIDNum(empID)

empDetail2.FirstName = "John"
empDetail2.Address1 = "1234 Main"
empDetail2.EMAIL = "myname@gmail.com"
' note these are not all of the fields in the structure. you can update any or all fields, as well as those included in the base
' structures

empDetail2.ESSPIN = "1234"
empDetail2.ObservesDST = True
empDetail2.EmpID = empID
empDetail2.ActiveStatus = 0;
empDetail2.ActiveStatusCondition = 1;

Dim addEmpMode As TAddEmpMode = TAddEmpMode.aemAuto
' setting this to auto will force the method to see if an employee with the EmpID already exists

Dim badgeManagement As TBadgeManagement = TBadgeManagement.bmAuto

Try
Dim res As TMaintainEmployeeResult = ws.maintainEmployeeDetail2(empDetail2, 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.
  • When doing an Add, make sure to set the values for both the ActiveStatus and ActiveStatusConditionID.
  • The TAeEmployeeDetail2 structure descends from the TAeEmployeeBasic and TAeEmployeeDetail structures and contains all the fields present in those structures
  • This method will seek out individual field by field changes and apply changes to only those fields that contain valid data different from the employee’s current assignment. Also, for those fields associated with an effective date, the effective date will be automatically applied if not specified.
  • For example: The CurrentRate field contains the employee’s current rate of pay. If this field is changed, indicating that the employee’s rate has changed, the system will also look at the value of the CurrentRateEffDate field. This field contains the date the new rate of pay will take effect. If this field is zero (unassigned) the system will automatically populate this date with the current date and make the new rate effective on the date the rate was changed. If the current value of CurrentRate is sent along with a new CurrentRateEffDate, the effective date is changed for the existing rate. The rate does not change and is not logged as a changed rate.
  • When the employee’s Pay Type is changed, a new current rate is expected. While -1 is a “no change” value for CurrentRate, any integer will be accepted in this case.

Possible Errors

  • Invald date formats

Alternate Method

setEmployeeDetail2

getEmployeeDetail2ByIDNum
getEmployeesListDetail2FromHyperQuery
getEmployeesListDetail2FromHyperQueryWorkgroupFilter
getEmployeesSearchListDetail2
getEmptyEmployeeDetail2
maintainEmployeeResultDescr
maintainPayrollEmployee

Back to Top