Class: ApprovalProcess

Process~ApprovalProcess

new ApprovalProcess(conn)

A class which manages approval processes
Parameters:
Name Type Description
conn Connection Connection object
Source:

Methods

approve(workitemId, commentsopt, optionsopt, callbackopt) → {ApprovalProcessRequest}

Approve approval request for an item
Parameters:
Name Type Attributes Description
workitemId String ID of the item that is being acted upon
comments String <optional>
Comment to add to the history step associated with this request
options Object <optional>
Request parameters
Properties
Name Type Attributes Description
nextApproverIds Array.<String> <optional>
If the process requires specification of the next approval, the ID of the user to be assigned the next request
processDefinitionNameOrId String <optional>
Developer name or ID of the process definition
skipEntryCriteria Boolean <optional>
Determines whether to evaluate the entry criteria for the process (true) or not (false) if the process definition name or ID isn’t null
callback Callback.<ApprovalProcessRequestResult> <optional>
Callback function
Source:
Returns:
Type
ApprovalProcessRequest

list(callbackopt) → {Promise.<Map.<String, Array.<ApprovalProcessDefinition>>>}

Get all approval process definitions registered to sobjects
Parameters:
Name Type Attributes Description
callback Callback.<Map.<String, Array.<ApprovalProcessDefinition>>> <optional>
Callback function
Source:
Returns:
Type
Promise.<Map.<String, Array.<ApprovalProcessDefinition>>>

reject(workitemId, commentsopt, optionsopt, callbackopt) → {ApprovalProcessRequest}

Reject approval request for an item
Parameters:
Name Type Attributes Description
workitemId String ID of the item that is being acted upon
comments String <optional>
Comment to add to the history step associated with this request
options Object <optional>
Request parameters
Properties
Name Type Attributes Description
nextApproverIds Array.<String> <optional>
If the process requires specification of the next approval, the ID of the user to be assigned the next request
processDefinitionNameOrId String <optional>
Developer name or ID of the process definition
skipEntryCriteria Boolean <optional>
Determines whether to evaluate the entry criteria for the process (true) or not (false) if the process definition name or ID isn’t null
callback Callback.<ApprovalProcessRequestResult> <optional>
Callback function
Source:
Returns:
Type
ApprovalProcessRequest

request(requests)

Send bulk requests for approval process
Parameters:
Name Type Description
requests Array.<ApprovalProcessRequest> Array of approval process request to send
Callback.<Array.<ApprovalProcessRequestResult>> Callback function
Promise.<Array.<ApprovalProcessRequestResult>>
Source:

submit(contextId, commentsopt, optionsopt, callbackopt) → {ApprovalProcessRequest}

Submit approval request for an item
Parameters:
Name Type Attributes Description
contextId String ID of the item that is being acted upon
comments String <optional>
Comment to add to the history step associated with this request
options Object <optional>
Request parameters
Properties
Name Type Attributes Description
nextApproverIds Array.<String> <optional>
If the process requires specification of the next approval, the ID of the user to be assigned the next request
processDefinitionNameOrId String <optional>
Developer name or ID of the process definition
skipEntryCriteria Boolean <optional>
Determines whether to evaluate the entry criteria for the process (true) or not (false) if the process definition name or ID isn’t null
callback Callback.<ApprovalProcessRequestResult> <optional>
Callback function
Source:
Returns:
Type
ApprovalProcessRequest