Creating a Simple Flow

How to Create a Simple Flow

Flows are a great tool for Salesforce admins because they have the power of code without having to actually write any code or test classes.  They can be deployed in a fraction of the time.I made a simple flow to assign a case record to the current logged in user.  This saves a support user some time when assigning cases to themselves.  Not much time, but it adds up.Use Case:We will add a custom button to the Case detail page labelled “Assign To Me”.  When a user clicks the button, the case owner is changed to himself/herself and the detail page reloads.Goal:To save user clicks.  Clicks are money.Components:

  • Custom Button
  • Flow

First create the flow.  In setup menu, search for “Flow”, then add a new flow.The flow designer will open.FlowDesigner

We will need three elements in our flow: a variable to hold the id of the case record, a formula to determine the id of the currently logged in user, and a Record Update element to update the case record.We will call our variable “caseid”.  It must allow input, which means values from outside the flow may be passed in.Variable

Our formula will use standard Salesforce global variable to get the id of the currently logged-in user.

Formula

Next add a "Record Update" element. Choose Case as the object, and the matching criteria should be the id equals our variable.

RecordUpdate

Remember to activate your flow once finished.  Copy the URL to use in our custom button.CustomButton

Finally our custom button will reference the URL of the flow, and pass in the case id as a variable.

Add your custom button to the page layout and test.

Responses

Comments are closed.

Popular Salesforce Blogs