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

  • Allows an employee to remove a previously created leave request

Syntax

  • AeXMlBridge.empRemoveLeaveRequestEntry(UniqueID, Comments);

Parameters

  • Integer - UniqueID (value from a valid TAeTimeOffRequest structure)
  • String - comments

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
string minDate = DateTime.Now.ToString("yyyy-MM-dd");                      
string maxDate = DateTime.Now.AddDays(30).ToString("yyyy-MM-dd");
// set date range for leave requests

string empID = "1234";
// using employee# "1234"

TAeTimeOffRequest[] reqs = ws.extractEmployeeLeaveRequestsByIDNum(empID, TRTOFilterEnum.rfCreated, 1, minDate, maxDate);
// retrieve list of employee's leave requests within date range

foreach (TAeTimeOffRequest req in reqs)
// iterate through records
{
if (req.ReqState == 1)
// Leave Request in submitted state
{
try
{
comments = "removing incorrect entry";
ws.empRemoveLeaveRequestEntry(req.UniqueID, comments);
}
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 minDate As String = DateTime.Now.ToString("yyyy-MM-dd")
' set date range for leave requests
Dim maxDate As String = DateTime.Now.AddDays(30).ToString("yyyy-MM-dd")

Dim empID As String = "1234"
' using employee# "1234"

Dim reqs As TAeTimeOffRequest() = ws.extractEmployeeLeaveRequestsByIDNum(empID, TRTOFilterEnum.rfCreated, 1, minDate, maxDate)
' retrieve list of employee's leave requests within date range

For Each req As TAeTimeOffRequest In reqs
' iterate through records

If req.ReqState = 1 Then
' Leave Request in submitted state

Try
comments = "removing incorrect entry"
ws.empRemoveLeaveRequestEntry(req.UniqueID, comments)
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
End If
Next

Remarks

  • This method removes a leave request
  • The UniqueID specifies the leave request to be cancelled
  • The comments value can be used to send comments back to the employee who made the request
  • ReqState field must be = 1 (in submitted state)

Possible Errors

  • Leave request with ID unavailable

Alternate Method

empRemoveLeaveRequestEntryMess

approveCancelLeaveRequestEntry
approveCancelLeaveRequestEntryMess
approveLeaveRequestEntry
approveLeaveRequestEntryEx
approveLeaveRequestEntryMess
denyCancelLeaveRequestEntry
denyCancelLeaveRequestEntryMess
denyLeaveRequestEntryEx
denyLeaveRequestEntryMess
describeLeaveRequestEntry
empCancelLeaveRequestEntry
empCancelLeaveRequestEntryMess
extractEmployeeLeaveRequest
extractEmployeeLeaveRequestsByIDNum
extractEmployeeLeaveRequestHist
extractLeaveRequestsByState
extractTimeOffRequestStates
leaveRequestIsCancelable
leaveRequestIsRemovable
removeLeaveRequestEntry
submitTimeOffRequest
submitTimeOffRequestEx
submitTimeOffRequestMess

Back to Top