leaveRequestIsRemovable() Method

Table of Contents

  1. Function
  2. Syntax
  3. Parameters
  4. Return Value
  5. Sample Code
  6. Remarks
  7. Possible Errors
  8. Related Methods

Function

  • Identifies whether or not a particular leave request can be removed based upon its status

Syntax

  • Boolean = AeXMLBridge.leaveRequestIsRemovable(UniqueID);

Parameters

Return Value

  • Returns a boolean value determining if the leave request can be removed or not

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
string empID = "1234";
// using employee with ID 1234

string minDate = DateTime.Now.ToString("yyyy-MM-dd");
string maxDate = DateTime.Now.AddDays(90).ToString("yyyy-MM-dd");
// set date range to retrieve employee leave requests

TAeTimeOffRequest[] requests = ws.extractEmployeeLeaveRequestsByIDNum(empID, TRTOFilterEnum.rfCreated, 1, minDate, maxDate);
// extract leave records

if (requests.Length > 0)
// making sure we have some leave request records
{
try
{
bool removable = ws.leaveRequestIsRemovable(requests[0].UniqueID);
}
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
Dim empID As String = "1234"
' using employee with IDy 1234

Dim minDate As String = DateTime.Now.ToString("yyyy-MM-dd")
' set date range to retrieve employee leave requests
Dim maxDate As String = DateTime.Now.AddDays(90).ToString("yyyy-MM-dd")

Dim requests As TAeTimeOffRequest() = ws.extractEmployeeLeaveRequestsByIDNum(empID, TRTOFilterEnum.rfCreated, 1, minDate, maxDate)
' extract leave records

If requests.Length > 0 Then
' making sure we have some leave request records

Try
Dim removable As Boolean = ws.leaveRequestIsRemovable(requests(0).UniqueID)
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
End If

Remarks

  • A removable leave request is one that has been submitted, but the supervisor has not yet approved or denied, and is allowed to be removed by the employee
  • UniqueID parameter can be obtained from a valid TAeTimeOffRequest structure

Possible Errors

  • Leave request with ID unavailable

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

Back to Top