先貼個官方幫助:
https://help.salesforce.com/articleView?id=extend_click_process.htm&type=5
Flow(流)是Salesforce中實現(xiàn)業(yè)務自動化的一個程序旭愧,可以實現(xiàn)搜集用戶信息,執(zhí)行判斷邏輯纽匙,展現(xiàn)給用戶信息等業(yè)務。在Classic中的叫Visual Flow蹈垢,Lightning experience中叫Flow议蟆。
Lightning Flow是Salesforce的一個產(chǎn)品,包括兩個工具Process Builder和Flow Builder(官方解釋),相比來說Flow更強大仰猖。
Flow Builder 是創(chuàng)建Flow一個工具。
Flow就是利用Flow Builder創(chuàng)建的一個具體實例奈籽。
參考的博文:https://www.cnblogs.com/donlyluik/p/Lightning-Flow.html
一饥侵、Flow Builder的介紹
Flow主要包含三個構(gòu)建塊:Elements、Connectors 和 Resources衣屏。
1.1 Elements
? ?????Screen - 需要與用戶交互的一個類型躏升,比如需要獲取用戶的一些輸入,或者需要通過Flow給用戶展現(xiàn)一些內(nèi)容狼忱。
? ????Logic - 控制流程的分支膨疏。Decision相當于條件判斷,這個判斷可以是簡單的Yes钻弄,No佃却,也可以是更復雜的規(guī)則,滿足規(guī)則時執(zhí)行后面連接器分支窘俺。Assignment可以更新某一個變量的值饲帅;Loop循環(huán)執(zhí)行;Pause暫停執(zhí)行。
? ????Actions - Flow自動執(zhí)行的一些動作灶泵,包括查詢記錄育八、創(chuàng)建or更新or刪除記錄、發(fā)送郵件赦邻、還可以使用Apex執(zhí)行更復雜的動作髓棋。
? ????Integrations - 與外部數(shù)據(jù)的集成交互。
1.2 Connetors
? ? 連接器的作用定義流程的走向惶洲,告訴流程接下來要做什么按声。
1.3 Resources
? ? ???Contstant-常量
? ? ???Variable(變量) - 保存一個在流程中可能改變的值,比如不同記錄的值不同湃鹊,或者根據(jù)不同的條件值不同儒喊。
? ? ???Create a Variable 創(chuàng)建一個變量的步驟:
? ? ? ? ? ?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的使用
創(chuàng)建完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按鈕芽丹,點擊,執(zhí)行剛才創(chuàng)建的Flow - Hello World卜朗。
2.3 Uitility Bar Flow
flow顯示在任何應用的下方
2.4Process Builder調(diào)用
Process Builder添加Actions可以直接調(diào)用一個Flow拔第。
Process Builder和Flow的區(qū)別可以參考這篇文章: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.