Approval
Supported Calls
describeSObjects(), query(), retrieve()
Fields
Usage
This object allows client applications to programmatically handle approval requests for a Contract. Initially, to request a Contract approval, a client application might create a new Approval request record, specifying the ParentId, OwnerId (user approving or rejecting the request), Status (Pending), and (optionally) RequestComment fields. Note that when a client application creates the first approval request, if the value of the Contract Status field is Draft, then the Approval Status for this record is automatically changed to In Approval Process (see ContractStatus for more information).
A client application might subsequently update an existing Approval request, specifying the Status (Approved or Rejected) and an ApproveComment (required); the RequestComment field can't be updated. Updating an Approval record (either to approve or reject) requires the client application to be logged in with “Approve Contract” permission. To update an Approval request, its Status must be Pending—a client application can't update an Approval that has already been Approved or Rejected. To re-submit an approval request for a given Contract, a client application must create a new, separate Approval record and repeat the approval process.
Once a Contract has been approved (not rejected), the Contract LastApprovedDate field is automatically updated, however the Contract Status field isn't updated, it keeps the value InApproval.
An approved Contract must be activated explicitly. Client applications can activate a Contract by setting the value in its Status field to Activated, or a User can activate a Contract via the Salesforce user interface.
A Contract can have multiple approval requests in various states (Pending, Approved, and Rejected). In addition, one User can have multiple approval requests associated with the same Contract.
Client applications can't explicitly deleteApproval records. Approval records are deleted automatically if the parent Contract is deleted.