Weekly Timesheet Record Actions
The weekly timesheet record type currently supports the approve, reject, and submit actions.
For help working with this record in the UI, see Weekly Timesheets.
For information about SuiteScript 2.x record actions, see the following help topics:
approve
Corresponding UI Button |
Approve All Pending |
Action Description |
Approve all pending timebills that the user has permission to approve on the timesheet with the specified ID. |
Returns |
{"id":recordId}, list containing all timeBills’ "notifications":[ Error, Warning, Information and text] } |
Supported Script Types |
Client and server scripts For additional information, see SuiteScript 2.x Script Types. |
Governance |
5 usage units |
Since |
2018.2 |
Parameters
See action.execute(options) for details about parameters required for the execution of any action. The approve action does not support any additional parameters.
reject
Corresponding UI Buttons |
Reject All Pending Reject All Pending with note |
Action Description |
Reject all pending timebills that the user has permission to reject on the timesheet with the specified ID. Optionally include a note that explains the reason for the rejection. Available when the Advanced Approvals on Time preference is enabled. |
Returns |
{"id":recordId}, list containing all timeBills’ "notifications":[ Error, Warning, Information and text] } |
Supported Script Types |
Client and server scripts For additional information, see SuiteScript 2.x Script Types. |
Governance |
5 usage units |
Since |
2018.2 |
Parameters
See action.execute(options) for details about parameters required for the execution of any action. The reject action also supports the following additional parameter.
Parameter |
Type |
Required / Optional |
Description |
Since |
---|---|---|---|---|
note |
string |
optional |
An explanation of why the pending timebills were rejected. |
2018.1 |
retract
Corresponding UI Button |
Retract |
Action Description |
Retracts pending timebills on the timesheet with the specified ID. Retract changes the record's approval status from PENDING state back to OPEN state. |
Returns |
{"id": recordId, "action": "retract", "success": [true or false], "recordCount": number of retracted timebills, "platformResponses": {timeBillId_1: responseObjectForTimeBill_1, timeBillId_2: responseObjectForTimeBill_2, ...}} |
Supported Script Types |
Client and server scripts For additional information, see SuiteScript 2.x Script Types. |
Since |
2021.1 |
Parameters
See action.execute(options) for details about parameters required for the execution of any action. RecordId is a default input parameter for this action. No additional input parameters are necessary.
Sample Return Objects
The following sample shows how to use a retract action on weekly timesheet.
{
{
"id": recordId,
"action": "retract",
"success": [true or false],
"recordCount": number of retracted timebills,
"platformResponses":
{
timeBillId_1: responseObjectForTimeBill_1,
timeBillId_2: responseObjectForTimeBill_2,
...
}
},
"notifications":[ Error, Warning, Information and text]
}
submit
Corresponding UI Buttons |
Submit |
Action Description |
Submit open and rejected timebills on the timesheet with the specified ID. Available when the Advanced Approvals on Time preference is enabled. |
Returns |
{"id":recordId}, list containing all timeBills’ "notifications":[ Error, Warning, Information and text] } |
Supported Script Types |
Client and server scripts For additional information, see SuiteScript 2.x Script Types. |
Governance |
5 usage units |
Since |
2018.2 |
Parameters
See action.execute(options) for details about parameters required for the execution of any action. The submit action does not support any additional parameters.