Tutorial: Using flows as Salesforce records

Content under development

You can use flows as records in Salesforce. Boomi Flow integrates seamlessly with Salesforce, letting your users/agents launch a Boomi Flow Visualforce page when they click View, Create, or Edit – without leaving Salesforce, and as easily as loading a Salesforce record.

Boomi Flow manages flow states automatically; so your users/agents can come back to the flow embedded as a record in your Salesforce org at any time, and continue the rest of the flow. We use a Join URL for this – which acts as a pointer for the user/agent to join the current flow state, even even they had moved to a different record or tab earlier.

To point to a flow when your user clicks on Salesforce record, create a custom object in Salesforce, and add the Join URL as a custom field. You can then create a new Apex class, clone a copy of the Boomi Flow Visualforce page, and use the Apex class as the standard controller in the page. You can then modify the View/Edit/New options from the Button, Links and Actions menu in Objects to point to the Visualforce page. Detailed instructions on how to do this are available in the following sections.

If you want to try out the instructions, use a flow you already have or create a new Salesforce flow as shown in the following procedures.


Creating a new Salesforce flow
  1. Click LOG IN to login to the Boomi Flow Drawing Tool and click New Flow.
  2. Select Flows in the sidebar, and click New Flow. 
  3. From the drop-down Which Service should be used for authentication? menu, select Salesforce and click Continue. This opens the Flow: New Flow screen. (Note: Since we are using the Salesforce service for authentication, we do not need to import it separately into the flow.)
  4. In the Name field, type a name for your flow (Example: Salesforce Chatter action).
  5. Select Any user that can login with the selected identity service can run this flow from the Access drop-down menu.
  6. Select None from the Social feed for collaboration drop-down menu.
  7. Click Start Building! This opens the canvas where we will build our flow.
  8. Drag an Operator element from the sidebar to the canvas.

    This opens a configuration panel on the right.
  9. Copy-paste Create sample record in the Name field and click New Operation.
  10. Click Select or create a new value.
  11. Click Create a new Value.
  12. Type Sample in the Name field.
  13. Select Object in the What kind of Value is this? field.
  14. Click Select a Type.
  15. Enter Sample in the Search field and select the Sample associated with the Salesforce Service.
  16. Click Save.
  17. Select Create New in How do you want to change the Value? and click Apply Operation.
     
  18. Click New Operation.
  19. Click Select or create a new value.
  20. Enter JoinUri in the Search field and select the Sample/JoinURI value.
  21. Select Set Equal To in the How do you want to change the Value? field.
  22. Select Value Of in the How do you want to retrieve the reference Value? field.
  23. Click Select or create a new Value in the Which Value do you want to reference? field.
  24. Enter join in the Search field and select the $JoinURI value.
  25. Click Apply Operation.
  26. Click New Operation.
  27. Click Select or create a new Value.
  28. Enter Sample in the Search field and select the Sample associated with the Salesforce Service.
  29. Click Save.
  30. Select Set Equal To in How do you want to change the Value?
  31. Click Apply Operation.

  32. Click Save Operator.

    This is what the canvas looks like now:
  33. Hover your mouse on Start. The mouse pointer changes from a crossbar to a hand.
  34. Drag an arrow from Start to Create sample record.
  35. In the Configuration Panel, type Go in the Name text field, and click Save Outcome.

    This is what the canvas looks like now:
  36. Drag a Save element to the canvas.
  37. Enter Save sample in the Name field, and click New Data Action.
  38. Click Select or create a new Value.
  39. Enter Sample in the Search field and select the Sample associated with the Salesforce Service.
  40. Click Save.
  41. Select Salesforce.com Sample__c Binding in Where will the data be saved?
  42. Click Apply Data Action.
  43. Click Save Database Save.

    This is what the canvas looks like now:
  44. Hover your mouse on Create sample record. The mouse pointer changes from a crossbar to a hand.
  45. Drag an arrow from Create sample record to Save sample.
  46. In the Configuration Panel, type Done in the Name text field, and click Save Outcome.

    This is what the canvas looks like now:
  47. Drag a Step element to the canvas.
  48. Type Step 1 in the Name field.
  49. Copy-paste this text in the content editor: Hi! We are seeeing how to override a Salesforce Object UI with a flow here. Click Next please. 🙂 
  50. Click Save Step.

    This is what the canvas looks like now:
  51. Hover your mouse on Save sample. The mouse pointer changes from a crossbar to a hand.
  52. Drag an arrow from Save sample to Step 1.
  53. In the Configuration Panel, type Saved in the Name text field, and click Save Outcome.

    This is what the canvas looks like now:
  54. Drag a Step element to the canvas.
  55. Type Please wait in the Name field.
  56. Copy-paste this text in the content editor: Lets try this! Click somewhere else in Salesforce. (Setup, perhaps?) Now come back to the record you just created in Salesforce. 
  57. Click Save Step.

    This is what the canvas looks like now:
  58. Hover your mouse on Step 1. The mouse pointer changes from a crossbar to a hand.
  59. Drag an arrow from Step 1 to Please wait.
  60. In the Configuration Panel, type Next in the Name and Label text fields, and click Save Outcome.

    This is what the canvas looks like now:

Configuring the record in Salesforce
  1. Login to Salesforce and click Setup.
  2. Click on Create to expand the options, and select Objects.
  3. Click New Custom Object.
  4. Type Sample in the Label field and Samples in the Plural Label field. The Object Name gets populated as Sample and the Record Name gets populated as Sample Name. The Data Type is set to Text as default. You can change any of these based on your requirements.
  5. Click Save to save the object. This opens the Custom Object Sample page.
  6. Click New under Custom Fields & Relationships.

    This opens the New Custom Field screen.
  7. Select URL from the Data Type options and click Next.
  8. Type JoinURI in the Field Label field. This populates the Field Name field as well.
  9. Click Next.
  10. You do not need to change any field-level security options. Click Next.
  11. You do not need to change the page layout options. Click Save.
  12. Click on the Develop menu to expand it.
  13. Click Apex Classes.
  14. Click ManyWhoFlowController.
  15. Copy the code block.
  16. Click Apex Classes again and click New.

    This opens the screen for a new Apex class.
  17. Paste the code into the new class.
  18. Change the name of the public class ManyWhoFlowController in the code to public class ManyWhoFlowSampleController in Ln 1 and Ln 5. (Sample is the name of the Object we created earlier.) This is what the code should be now:
  19. Change all instances of ManyWhoFlow__c to Sample __c.
  20. Change all instances of manywhoflows to samples

    This is what the code should be now:
  21. Click Save to save the class.
  22. Click Visualforce Pages in the Develop menu.
  23. Select the ManyWhoFlow page by clicking the page label.
  24. Click Clone.
  25. Type ManyWhoFlowSample in the Name field.
  26. Type flowsample in the Label field.
  27. Delete the comments warning us to not change the code of the page. (This is not the original Visualforce page, but a clone.)
  28. Edit the first line of the code from <apex:page standardController=”ManyWhoFlow__c” extensions=”ManyWhoFlowController”> to <apex:page standardController=”Sample__c” extensions=”ManyWhoFlowSampleController”>
  29. In the section where the code is passing input values into the page, change object-id to id. There are three places in the code where this change needs to be made. (Ln 101, Ln 102 and Ln 107 in the image).
  30. Click Quick Save to save the page.
  31. We will hardcode the Flow ID where the ManyWho engine is being initialized. Replace the term flowID with the ID of your flow within single quotes (‘). (Example: ‘c73921c2-6d5b-4aa9-805f-114f53a2d8e4’. Ln 161 in the image.)
  32. Click Save to save the page.
  33. Click the Create menu to expand the options and select Objects.
  34. Select Sample.
  35. Click Button, Links, and Actions.
  36. Click the Edit link next to the Edit label.
  37. Select Visualforce Page in the Override With option.
  38. Select the ManyWhoFlowSample page and click Save.
  39. Click Button, Links, and Actions.
  40. Click the Edit link next to the New label.
  41. Select Visualforce Page in the Override With option.
  42. Select the ManyWhoFlowSample page and click Save.
  43. Click Button, Links, and Actions.
  44. Click the Edit link next to the View label.
  45. Select Visualforce Page in the Override With option.
  46. Select the ManyWhoFlowSample page and click Save. The Edit, New, and View buttons now link to the Visualforce page you created, instead of the default Salesforce.com page.

    Based on your business needs, you can link the Visualforce page to any of the button or link options available.
  47. Enter Salesforce Setup and click Create.
  48. Click Tabs.
  49. Click New.
  50. Select Sample for the Object field and click the Search icon next to Tab Style.
  51. Select a tab style you like. Example: Apple.

    This populates the Tab Style field with the style you have selected.
  52. Click Next.

    This opens the Step 2: Add to Profiles screen.
  53. Click Next.

    This opens the Step 3: Add to Custom Apps screen.
  54. Click Save.

    You can see the new tab in your list of Custom Object Tabs.

Appchievement

Let’s see how a flow works in place of a record now:

  1. Switch to the Salesforce Sales Console.
  2. Expand the drop-down menu on the top right-hand corner and select Samples.

    This opens the Samples tab.
  3. Click Create New and select Sample.

    You can see the flow now:

    The content you see was created in the Step element of the flow you built earlier.
  4. Click Next. This opens a new Step element in the flow, and you can see its contents in Salesforce. Notice how seamless the experience is! The flow looks and feels like it is a part of your Salesforce org.
  5. Click anywhere else on Salesforce. When you come back to the sample, you rejoin the flow where you left off:

    Like this:

Check out the glossary for a definition of terms and key concepts that appear in the Boomi Flow website, Drawing Tool, technical documentation, blogs, and marketing communications.

If you need to take a closer look, click on the images to enlarge them. Have a question? Click the Help button on the bottom right-hand corner of this page to ask.