我是靠谱客的博主 落后电脑,最近开发中收集的这篇文章主要介绍Salesforce自动化工具比较(Workflow, Process Builder, Flow & Apex Trigger),觉得挺不错的,现在分享给大家,希望可以做个参考。

概述

前言】:由于SF知识一直在不断革新和进化,本文不能保证你看到时的内容是最新的,但能保证的是会定期更新和更正。

4种自动化工具】:

1、Workflow Rules的技术边界:Cross-Object Workflow
触发条件:某一个记录被创建/编辑且满足某一标准,该标准指的是选定的对象或与选定的对象相关的某字段等于/不等于/大于...某一个值时触发;
局限:如果对象是lookup关系,仅能更新该选定对象的值,而不能更新与之相关字段的值,简而言之,不能跨对象更新,master-detail可以
缺陷:workflow更新记录消耗CPU,所以当在代码中遇到CPU超限的问题时,可考虑将workflow的更新操作整合进apex code;

2、Process Builder的技术边界:(更新相关字段首选)
触发条件:某一记录被save时;
缺陷:不能删除编辑好的Process,只能Inactive (除非使用Metadata API操作),不能修改已经编辑过的Process,只能clone,触发条件为created/edited;
相比workflow的优势:
a、流程图的方式写逻辑和action更直观;
b、执行action的时候,可以update选定对象的相关字段的值,而不仅局限其对象本身的field;
c、能跨对象更新,不管是跨父级还是跨子级更新都行

注:任何更新字段实际上是通过DML操作实现的,不管操作是绑定在button上还是如何。
最佳实践:实施时请务必遵循一个对象一个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

最后

以上就是落后电脑为你收集整理的Salesforce自动化工具比较(Workflow, Process Builder, Flow & Apex Trigger)的全部内容,希望文章能够帮你解决Salesforce自动化工具比较(Workflow, Process Builder, Flow & Apex Trigger)所遇到的程序开发问题。

如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(72)

评论列表共有 0 条评论

立即
投稿
返回
顶部