Salesforce自动化工具比较(Workflow, Process Builder, Flow & Apex Trigger)



1、Workflow Rules的技术边界Cross-Object Workflow
缺陷:workflow更新记录消耗CPU,所以当在代码中遇到CPU超限的问题时,可考虑将workflow的更新操作整合进apex code;

2、Process Builder的技术边界:(更新相关字段首选)

最佳实践:实施时请务必遵循一个对象一个Process Builder的原则。以下是Process Builder和NPSP应用程序代码之间相互影响造成的Exception Error,Support给的解决方案:

A solution for this would be to consolidate the six active process builders on the opportunity object and use the best practice of 1 Process per Object. If they can order the OwnerId reassignment that is occurring in the process builder called "Opportunity Owner Reassignment & Target Dept. Update" to come after the Engagement Plan creation, they won't run into this issue.

3. Flow Update New and Changed Records by Using Before-Save Updates in Flows

功能特征:In Spring ’20, creating or updating a record can now trigger an autolaunched flow to make additional updates to that record before it's saved to the database

前置条件:To activate a flow that makes before-save updates, an app builder needs the View All Data permission.

Flow优点:Before-save updates in flows are much faster than other available record-triggered updates.

Flow之于PBA before-save update in a flow is 10 times faster than an update in a record-change process that’s built in Process Builder. Perhaps you’re familiar with Process Builder and using a record-change process to make additional updates to each record that triggers the process. Such a process can set the Region custom field automatically on each new case record. Before-save updates in flows accomplish that same goal, but much more quickly because each record doesn’t get saved to the database again. Avoiding that extra save procedure means skipping another round of assignment rules, auto-response rules, workflow rules, and other customizations that take time to execute.

Flow之于Trigger:A flow that makes before-save updates is similar to a before trigger. In a save procedure, before-save updates in flows are executed immediately prior to Apex before triggers.

Because of their speed, we recommend that you use before-save updates in flows to update fields on new or changed records. You can even avoid the limit for maximum CPU time on the Salesforce servers by replacing Apex code and record-change processes with before-save updates in flows. However, sometimes you need to use a record-change process or an Apex after trigger to:

  • Access field values that are set only after the record is saved, such as the Last Modified Date field or the ID of the new record.
  • Create or update related records.
  • Perform actions other than updating the record that launches the flow.

Action比较】:workflow vs process builder


©️2020 CSDN 皮肤主题: 编程工作室 设计师:CSDN官方博客 返回首页