Save approver automatically in Approval Processes with Process Builder and Flows
- Dec
- 11
- Posted by Lin
- Posted in Other, Salesforce
In previous post,I shared how to 《Create Roll-Up Summary field to count Contacts on Account with Process Builder and Flows》.
In this post I will share about how to save approver(current user) to the target object automatically in Approval Processes, with Process Builder and Flows.
Actually,this is another interesting usages of Process and Visual Flows.
Here is the list of setting we need to create,include Approval Processes:
・Custom Fields (Contract Object)
・ContractApproval (Approval Processes)
・ContractApproverUpdate (Flows)
・ApproverUpdateProcess (Process Builder)
※The Process “ApproverUpdateProcess” we need to create next will not be evaluated if it’s without that option.
Enjoy it!
In this post I will share about how to save approver(current user) to the target object automatically in Approval Processes, with Process Builder and Flows.
Actually,this is another interesting usages of Process and Visual Flows.
Here is the list of setting we need to create,include Approval Processes:
・Custom Fields (Contract Object)
・ContractApproval (Approval Processes)
・ContractApproverUpdate (Flows)
・ApproverUpdateProcess (Process Builder)
New custom fields
Create a custom field(Formula(Text)) on Contract named “CurrentUserId” for getting current running user. Create another custom field(Lookup(User)) named “Approver” for storing approver value.ContractApproval
Create an Approval Process named “ContractApproval” on Contract like the following image. And the Field Updates “StatusUnapproved”. Field Updates “StatusApproved”. Don’t foget to check the “Re-evaluate Workflow Rules after Field Change” option.Trust me, this is really important.※The Process “ApproverUpdateProcess” we need to create next will not be evaluated if it’s without that option.
ContractApproverUpdate
Create a Visual Workflow add a Fast Loopup element named “LookupTarget” to flow area. Create a Variable named “varTargetId” and a SObject Variable named “targetContract”. Add a Record Update element “ApproverUpdate” at the end. Now,set the Fast Loopup element to be a Start Element and link two elements. Save flow as “ContractApproverUpdate” and activate it.ApproverUpdateProcess
Create a process named “ApproverUpdateProcess” from Create > Workflow & Approvals > Process Builder. Add Contract object and save it. Add a criteria with the below Formula and save it. Add a action for the criteria when it is true,and select the flow “ContractApproverUpdate” we created before. Now activate the process.Operation check
Create a contract and submit for Approval with user “Staff” Approval contract with user “Manager” Not bad, isn’t it?Enjoy it!
Post Tagged with Approval Processes, Approver, Current User, no coding, Process, Process Builder, Salesforce, Visual Flow
Recent Posts
- Salesforce DevTools Release Notes (version 3.10.0) – mass edit custom fields on lightning
- Salesforce DevTools Release Notes (version 3.9.0) – Object Fields, SOQL Query Editor
- Salesforce DevTools Release Notes (version 3.8.0)
- Salesforce DevTools JUST HIT 10,000 USERS! THANK YOU!
- Using Promise for Apex Server-Side request in Lightning Component
Top Posts
- Salesforce DevTools – Powerful Salesforce developer tools, loved by over 50K developers - 221.1K views
- Date format and DateTime format - 205.6K views
- Salesforce Mass Editor (Chrome Extension) – Mass create, mass update, mass clone, mass delete on any list view. Support for both Classic and Lightning! - 159K views
- Setup an awesome Salesforce developer environment with Sublime Text 3 - 122.5K views
- Writing a Schedulable Batch Apex in Salesforce - 120.3K views
Categories
- APEX
- Apps
- Custom Label
- Custom Metadata
- Custom Setting
- Design & UI
- Event
- Heroku
- iOS & Object-c
- Lightnint Component
- Linux & Mac OS
- Metadata API
- Node.js
- Open Source
- Other
- PHP Framework
- Release Notes
- REST API
- Salesforce
- Salesforce DevTools
- Salesforce DX
- SOQL
- Tooling API
- Unit Tests
- Validation Rule
- Visualforce
- WordPress
You must be logged in to post a comment.