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

  • Used to deny the cancellation of a leave request and email the employee

Syntax

  • AeXMLBridge.denyCancelLeaveRequestEntry(UniqueID, AeTimeOffRequestNotification);

Parameters

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
29
30
31
32
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

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 == 4)
// ReqState must = 4 (cancel request state)
{
TAeTimeOffRequestNotification notify = new TAeTimeOffRequestNotification();
notify.BodyText = "some bodytext message";
notify.eMailAddress = "[[mailto:someone@somewhere.com|someone@somewhere.com]]";
notify.SubjectLine = "Deny Cancel Leave Request";

try
{
ws.denyCancelLeaveRequestEntryMess(reqs[i].UniqueID, notify);
}
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
25
26
27
28
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 60 days
Dim maxDate As String = DateTime.Now.AddDays(60).ToString("yyyy-MM-dd")

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
' iterate through list

If reqs(i).ReqState = 4 Then
' ReqState must = 4 (cancel request state)

Dim notify As New TAeTimeOffRequestNotification()
notify.BodyText = "some bodytext message"
notify.eMailAddress = "[[mailto:someone@somewhere.com|someone@somewhere.com]]"
notify.SubjectLine = "Deny Cancel Leave Request"

Try
ws.denyCancelLeaveRequestEntryMess(reqs(i).UniqueID, notify)
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
  • Used to send an email message back to the employee who made the request
  • ReqState field must be equal to ‘4’ (cancel state request)

Possible Errors

  • Leave request with ID unavailable

Alternate Method

denyCancelLeaveRequestEntry

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

Back to Top