NSOA.wsapi.reject(rejectRequest)
Use this function to reject bookings, timesheets, invoices, and envelopes. It can take an array of up to 1,000 reject request objects.
Parameters
-
rejectRequest{object} [required] — rejectRequest object
Returns
Array of ApprovalResult objects.
Units Limit
-
20 units
+10 for each additional object passed
For more information see Scripting Governance.
Since
October 15, 2016
Example
In this example, the script creates the approval object, then prepares the timesheet with timesheet ID 45 for rejection, defines the reject requests, and invokes the action call.
// Create the approval object
var approvalObj = new NSOA.record.oaApproval();
approvalObj.notes = "reject from scripting";
// Prepare the record for reject
var timesheetToProcess = new NSOA.record.oaTimesheet();
timesheetToProcess.id = 45;
// Define the reject requests
var requests = [{
reject: timesheetToProcess,
attributes: [], // reject attrributes are optional
approval: approvalObj
}];
// Invoke the action call
var results = NSOA.wsapi.reject(requests);
Note:
This simple example does not show error checking, see Handling Approval Errors
See Code Samples for more examples.