leaveRequestIsCancelable() 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 cancelled or not based upon its current status

Syntax

  • Boolean = AeXMLBridge.leaveRequestIsCancelable(UniqueID);

Parameters

Return Value

  • Returns a boolean value which determines if the leave request can be cancelled 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, TRTROilterEnum.rfCreated, 1, minDate, maxDate);
// extract leave records filtered by parameters

if (requests.Length > 0)
// make sure we have some Time Off Requests
{
try
{
bool cancelable = ws.leaveIsCancelable(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 ID 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, TRTROilterEnum.rfCreated, 1, minDate, maxDate)
' extract leave records filtered by parameters

If requests.Length > 0 Then
' make sure we have some Time Off Requests

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

Remarks

  • A cancelable leave request is one that has been submitted, approved and is allowed to be cancelled
  • 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
leaveRequestIsRemovable
removeLeaveRequestEntry
submitTimeOffRequest
submitTimeOffRequestEx
submitTimeOffRequestMess

Back to Top