appendEmpCertAssignByIDNum() 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 an employee certification assignment

Syntax

  • bool = AeXMLBridge.appendEmpCertAssignByIDNum(idNum, AeEmpCertAssign);

Parameters

Return Value

  • Boolean

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 appending to employee "1234"

try
{
TAeEmployeeBasic employeeBasic = ws.getEmployeeBasicByIDNum(empID);

TAeCertification[] certifications = ws.extractCertifications();

// just going to use the first one
TAeEmpCertAssign empCertAssign = new TAeEmpCertAssign()
{
CertGUID = certifications[0].GUID,
DateForm = TCertDateFormEnum.cdfAlways,
Comment = "Enter something here",
Effective = DateTime.Now.ToString("yyyy-MM-dd"), // today
Expires = DateTime.Now.AddYears(10).ToString("yyyy-MM-dd"), // 10 years from today
Filekey = employeeBasic.Filekey,
Rating = 1,
Score = 1,
};

bool itWorked = ws.appendEmpCertAssignByIDnum(empID, empCertAssign);

}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
return;
}

Sample Code VB.Net

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
Dim empID As String = "1234"

Try
Dim employeeBasic As TAeEmployeeBasic = ws.getEmployeeBasicByIDNum(empID)
Dim certifications As TAeCertification() = ws.extractCertifications()
Dim empCertAssign As TAeEmpCertAssign = New TAeEmpCertAssign() With {
.CertGUID = certifications(0).GUID,
.DateForm = TCertDateFormEnum.cdfAlways,
.Comment = "Enter something here",
.Effective = DateTime.Now.ToString("yyyy-MM-dd"),
.Expires = DateTime.Now.AddYears(10).ToString("yyyy-MM-dd"),
.Filekey = employeeBasic.Filekey,
.Rating = 1,
.Score = 1
}
Dim itWorked As Boolean = ws.appendEmpCertAssignByIDnum(empID, empCertAssign)
Catch ex As Exception
MessageBox.Show(ex.Message)
Return
End Try

Remarks

  • Use extractCertifactions to retrieve a list of GUID codes
  • Method will return true if record is added successfully, else false

Possible Errors

  • Employee with ID not found
  • Filekey does not exist

Alternate Method

appendEmpCertAssignByFilekey

extractCertifications
extractEmpCertAssignsByIDnum
getEmptyEmpCertAssign
removeEmpCertAssignByUniqueID

Back to Top