denyLeaveRequestEntryEx() Method

Table of Contents

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

Function

  • Used to deny a leave request, and add comments

Syntax

  • AeXMLBridge.denyLeaveRequestEntry(UniqueID, Comments);

Parameters

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

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

string minDate = DateTime.Now.ToString("yyyy-MM-dd");
string maxDate = DateTime.Now.AddDays(60).ToString("yyyy-MM-dd");
// date range to extract leave requests is from today up to and including the next 60 days

string comments = "denying leave request";

TAeTimeOffRequest[] reqs = ws.extractEmployeeLeaveRequestsByIDNum(empID, TRTOFilterEnum.rfCreated, 1, minDate, maxDate);
// retrieve list of Leave Requests for employee within date range

for (int i = reqs.Length - 1; i >= 0; i--)
// iterate through list
{
if (reqs[i].ReqState == 1)
// ReqState must = 1 (submitted request state)
{
try
{
ws.denyLeaveRequestEntry(reqs[i].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
Dim empID As String = "1234"
' using employee# "1234"

Dim minDate As String = DateTime.Now.ToString("yyyy-MM-dd")
' date range to extract leave requests is from today up to and including the next 60 days
Dim maxDate As String = DateTime.Now.AddDays(60).ToString("yyyy-MM-dd")

Dim comments As String = "denying leave request"

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

For i As Integer = reqs.Length - 1 To 0 Step -1
If reqs(i).ReqState = 1 Then
' must be 1 request state
Try
ws.denyLeaveRequestEntry(reqs(i).UniqueID, comments)
Catch ex as Exception
MessageBox.Show(ex.Message)
End Try
End If
Next

Remarks

  • This method marks a request as denied
  • The UniqueID specifies the leave request to be denied
  • The Comments value can be used to send comments back to the employee who made the request
  • ReqState field must be equal to ‘1’ (submitted state request)

Possible Errors

  • Leave request with ID unavailable

Alternate Methods

denyLeaveRequestEntry
denyLeaveRequestEntryMess

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

Back to Top