The series of article on the Visual Workflow is to discuss the basic concepts and to show the power of Flow. Visual Workflow allows you to automate business processes by building applications, known as Flows, that collect, update, edit, and create Salesforce information, and then make those flows available to the right users or systems. Flows can execute logic, interact with the Salesforce database, call Apex classes, and guide users through screens for collecting and updating data. There are various ways through which you can launch your Flows, one of them is Lightning App Builder. Let’s start with a business use case
Business Use Case
Rachel Gillett is working as System administrator at Universal Containers. She has developed a flow to get the Sales reps feedback. She wants to use the Lightning App to launch a Flow.
Solution for the above business requirement
We I’ll use Flow, Visualforce Page and Lightning App Builder to solve the above business requirement. Steps to create a Lightning App to launch the Flow are mentioned below
- Create a Flow
- Embed the Flow in a Visualforce Page
- Create a Lightning Page in Lightning App Builder
- Add Visualforce page as a component
- Activate the Lightning page. Activate adds your app the Saleforce1 Mobile navigation
Follow the below instructions to solve the above business requirement
1. Click on Name | Setup | App Setup | Create | Workflows & Approvals | Flows and then click on the New Flow button, it will open the Flow canvas for you. Create a sample Flow (Save it with the name Survey) as shown in the following screenshot
If you want step-by-step guide to creating the above flow, then check out this article Survey Powered by Visual Workflow
2. The next step is to embed the Flow in a Visualforce Page (Save it with the name Flow), to do this you can use the below-mentioned code
3. Now we will create a Lightning Page in Lightning App Builder. Click on Setup | Build | Develop | Lightning App Builder, then click on the New button under Lightning Pages to start Lightning App Builder. Choose one Column template (A template defines the basic behavior and layout of the page you plan to create) and click on the Next button. In the next screen, i.e. Create a New Lightning Page pop-up enter a unique name (TestApp) for your new page and click on the Finish button, as shown in the following screenshot
4. Drag-and-drop Visualforce Standard Lightning component onto the canvas, as shown in the following screenshot
You can use the control panel to select a Visualforce page (In our case select Flow) that you want to include, as shown in the following screenshot
Once you’re done, click on the Save button. It will save the current definition of your app.
5. The final step is to activate the Lightning page. Activate adds your app the Saleforce1 Mobile navigation.
It also allows you to set the Tab visibility.