Approval Processing with Apex in Salesforce

An approval process is an automated process your organization can use to approve records in Salesforce. Usually we can request/approve an approval process through the standard approval process feature, but we can also do those things with Apex in some cases such as : request/approve from VF Page or from Custom Button.

Here is Approval Process Objects ER :
Approval Process ER And here are the samples as the following Apex Code:

Request

Approval.ProcessSubmitRequest class provides the way to submit approval request(s).

Approve/Reject

And we can approve/reject that request through Approval.ProcessWorkitemRequest class.

Unlock

Once a record has been approved, we can unlock it through Approval.ProcessWorkitemRequestApproval.unlock().

In next post, I’ll share “How to do bulk Approval Processing from list view“.
Enjoy It! ^ ^

Related Post

Pipeline for Salesforce – Be less busy, less... Overview Pipeline is a metadata deploy app for Salesforce, supports: ・Making Changeset with Excel file in seconds. ・Exporting Pipeline target metadata list to Excel file. ・No dependencies on Salesforce Org, deploying metadata between any different organizations. ・Deploying metadata base o...
Salesforce Mass Editor (Chrome Extension) – ... This's my second Chrome Extension (First one is HERE) this year, named "Salesforce Mass Editor" and it supports for doing the below things : ・Makes any Salesforce list view to be a powerful mass editor. ・Mass insert, mass clone, mass update, mass delete, ALL-IN-ONE. Support for both Classic and ...
Salesforce Smart Importer – 1-Drag to import... This is my third Chrome Extension named Salesforce Smart Importer (Other two popular extensions are Salesforce Mass Editor and Salesforce DevTools), it is designed for Salesforce not only admin but also normal user, supports : ・1-Drag to import any Excel / CSV data on anywhere in Salesforce, both ...
Setup an awesome Salesforce developer environment ... Why Sublime Text 3 ? I've been working with Force.com for about 2 years, and always using Eclipse+Force.com IDE(See here, Eclipse Force.com IDE Installation)as my development environment. I don't think it is really difficult to use, but it could be more friendly. For example: 1. It doesn't suppo...