In the previous chapter, we discussed how we can create, update, and delete records using the Flow. We also discussed how to pass variable values through a custom button or link and redirect users to a page after completion of Flow. We also learned a way to display custom error messages in a Flow, and how to use JavaScript with a Flow. In this chapter, we will discuss how to use a style sheet with Flow, open Flow access for unauthenticated access, and use a controller to pass value into Flow variables. We will also discuss a few more ways to call the Flow. The following topics will be covered in this chapter:
In Chapter 3, Manipulating Records in Visual Workflow, we had discussed a way to display a meaningful error message to the users when an unhandled exception occurred at runtime. But apart from displaying the custom error message to users, it's also important to understand various ways through which you can debug the Flow.
Another way to debug the Flow is to keep a debug screen after each of the Flow elements (for example, after Record Lookup, Record Create, Record Delete, Record Update, Assignment, or Decision) while developing it. It will help you to check each variable or field value in every step, and you can also check whether the Flow is working as designed (following the correct path) or not. You can add any field onto the debug screen for which you want to check values at runtime. Once you are done with testing, then disconnect the screens for a normal running Flow, and in the future you can use it if required.
A business scenario: 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), we have developed a Flow, that is, Create Leads. Helina Jolly is working as a system administrator in Universal Container and she worked on this Flow. She received a few messages from business users saying that Flow stops creating leads into the system.
She is planning to add a debug screen after the Create Lead Record element to make sure that the Record Create element is working fine. The steps to debug the Flow are as follows:
Verify Lead Creations
; you can also add Description. Under the Navigation Options dropdown, select the Don't show Previous button option.Verify Lead Creation
and select resource {!VarTLeadID} from VARIABLES, as shown in the following screenshot:18.117.192.247