先贴个官方帮助:
https://help.salesforce.com/articleView?id=extend_click_process.htm&type=5
Flow(流)是Salesforce中实现业务自动化的一个程序,可以实现搜集用户信息,执行判断逻辑,展现给用户信息等业务。在Classic中的叫Visual Flow,Lightning experience中叫Flow。
Lightning Flow是Salesforce的一个产品,包括两个工具Process Builder和Flow Builder(官方解释),相比来说Flow更强大。
Flow Builder 是创建Flow一个工具。
Flow就是利用Flow Builder创建的一个具体实例。
参考的博文:https://www.cnblogs.com/donlyluik/p/Lightning-Flow.html
一、Flow Builder的介绍
Flow主要包含三个构建块:Elements、Connectors 和 Resources。
1.1 Elements
• Screen - 需要与用户交互的一个类型,比如需要获取用户的一些输入,或者需要通过Flow给用户展现一些内容。
• Logic - 控制流程的分支。Decision相当于条件判断,这个判断可以是简单的Yes,No,也可以是更复杂的规则,满足规则时执行后面连接器分支。Assignment可以更新某一个变量的值;Loop循环执行;Pause暂停执行。
• Actions - Flow自动执行的一些动作,包括查询记录、创建or更新or删除记录、发送邮件、还可以使用Apex执行更复杂的动作。
• Integrations - 与外部数据的集成交互。
1.2 Connetors
连接器的作用定义流程的走向,告诉流程接下来要做什么。
1.3 Resources
• Contstant-常量
• Variable(变量) - 保存一个在流程中可能改变的值,比如不同记录的值不同,或者根据不同的条件值不同。
• Create a Variable 创建一个变量的步骤:
1.Open Flow Builder. From Setup enter Flows in the Quick Find box and click Flows.
2.Click New Flow.
3.Select Screen Flow and click Create.
4.From the toolbox, click Manager.
5.Click New Resource.
6.For Resource Type, select Variable.
7.Enter an API name and description for your variable.
8.Select the appropriate data type.
9.If you want to store multiple values (a collection), select Allow multiple values.
10.For record variables, select the object whose record values you plan to store.
11.Identify the variable’s availability outside the flow.
ChoiceSet Picklist
Formual
Text Template
二、Flow的使用
创建完Flow,如何使用呢?Trailhead也介绍了几种方法:
2.1 Lightning组件-用于页面
New Page或者打开一个Lightning Page后Edit Page。
设置默认的主页:
Save 后,Activate可以分配Page。下图中点击Assign as Org Default,
设置完Flow后,点 Back返回页面,可以看到添加的Flow
2.2添加Action Flow
在对象中添加Action后,需要添加到页面布局,否则用户看不到。
In the Salesforce Mobile and Lightning Experience Actions section, click override the predefined actions if present.
Select Mobile & Lightning Actions in the palette, and then drag your action to the Salesforce Mobile and Lightning Experience Actions section.
在Page Layouts中添加完 Flow Action后,去打开一个记录(上面用的Contacts,下面截图是Accounts,效果是一样的),在button栏就能看到Flow Action按钮,点击,执行刚才创建的Flow - Hello World。
2.3 Uitility Bar Flow
flow显示在任何应用的下方
2.4Process Builder调用
Process Builder添加Actions可以直接调用一个Flow。
Process Builder和Flow的区别可以参考这篇文章:https://baijiahao.baidu.com/s?id=1667217730208180002&wfr=spider&for=pc
Flow类型介绍
https://help.salesforce.com/articleView?id=flow_concepts_type.htm&type=5
Flow actions aren't supported in Salesforce Classic.