Save approver automatically in Approval Processes with Process Builder and Flows
- 12月
- 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
近期文章
- 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的开发者用户突破10,000名!THANK YOU!
- Lightning Component中使用Promise处理Apex服务端请求
Top Posts
- Salesforce DevTools – Saleforce开发者必备Chrome扩展 - 225K views
- Date format 与 DateTime format - 208.7K views
- Salesforce批量编辑 (Chrome扩展) – 在任何标准视图上进行批量插入, 拷贝, 更新, 删除, 支持Classic与Lightning! - 160.5K views
- 编写一个可被计划执行的Batch Apex - 123.5K views
- 用Sublime Text 3架设Salesforce的快速开发环境 - 122.9K views
分类目录
- APEX
- 应用
- Custom Label
- Custom Metadata
- Custom Setting
- Design & UI
- 交流会
- 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
您必须登录才能发表评论。