NSOA.wsapi.unapprove(unapproveRequest)
Use this function to unapprove bookings, timesheets, invoices, and envelopes. It can take an array of up to 1,000 unapprove request objects.
Parameters
-
unapproveRequest{object} [required] — unapproveRequest 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 unapproval, defines the unapprove requests, and invokes the action call.
// Create the approval object
var approvalObj = new NSOA.record.oaApproval();
approvalObj.notes = "unapprove from scripting";
// Prepare the record for unapprove
var timesheetToProcess = new NSOA.record.oaTimesheet();
timesheetToProcess.id = 45;
// Define the unapprove requests
var requests = [{
unapprove: timesheetToProcess,
attributes: [], // unapprove attrributes are optional
approval: approvalObj
}];
// Invoke the action call
var results = NSOA.wsapi.unapprove(requests);
Note:
This simple example does not show error checking, see Handling Approval Errors
See Code Samples for more examples.