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