There are various concepts related to who can run the Flow and how, what kind of permission is required to run a Flow, and what happens when an organization wants to open a Flow for external users or unauthenticated access? To see the Flow detail page, users must have View Setup and Configuration system permission; the users that have the Manage Force.com Flow system permission can open, create, delete, activate, deactivate, or delete Flows.
A business scenario: Helina Jolly is working as a system administrator in Universal Container. She developed a Flow, that is, Create Leads, in Chapter 3, Manipulating Records in Visual Workflow (under the Hands on 1 – creating leads and Hands on 2 – adding leads to a campaign sections), and embedded it into the custom button. She has received several e-mails from users saying that they are getting Insufficient Privileges Errors when they click on the Create Lead button, as shown in the following screenshot:
If a system administrator embeds a Flow into the custom button or link, then to run a Flow, the user must have either the Run Flows system permission under profile, or the Force.com Flow User feature license selected in the user record.
A business scenario: Alice Atwood, who is working as a system administrator in Universal Container, received a requirement from her manager to grant the Create Leads Flow access to partner community users.
The partner community profile doesn't have the Run Flows system permission, and you can't assign the Force.com Flow User feature license to them. So, a way to work around this is to use Visualforce Page. The steps for granting permission to partner community users to a Flow are as follows:
<apex:page standardController="Campaign"> <flow:interview name="Create_Leads"> // Flow interview component is used to embed flow in a Visualforce page. Create_Leads is flow Unique Name. <apex:param name="VarTCampaignID" value="{!Campaign.ID}"/> // apex:param is used to pass variable CampaignID value to a flow </flow:interview> </apex:page>
Flow_Partner_Community
.Create Lead VF
; for Display Type select Detail Page Button, for Behavior select Display in existing window without sidebar or header, for Content Source select Visualforce Page, and then from the Content dropdown, select the Visualforce Page of Flow_Partner_Community, and click on OK. It will look like the following screenshot:If you have embedded the Flow into a Visualforce page, there are also few ways in which users can use it to run a Flow. They are as follows:
Until now we have seen many Flows, but invoking or calling a Flow requires user intervention. There are many requirements for which we want a way to automatically call without a manual intervention.
To improve user adoption in the organization, management at Universal Container wants to implement a business process: if a user has not logged in in the last 15 days, auto freeze their user account and send out an e-mail to the user as well as system administrator.
To solve this requirement, we have to use Flow, and to autofire Flow we can use Process Builder. We will see similar examples in detail in Chapter 6, Building Applications without Code.
3.147.75.221