WHAT CONDITION YOUR VALIDATION IS IN – Part 2

Standard

My recent post on bypassing validation rules (WHAT CONDITION YOUR VALIDATION IS IN) generated a record number of comments. It is all kinds of awesome to know that folks are reading the blog AND asking questions. whos-awesome

Two comments in particular were around pushing the userID over to the flow. After much facepalming, I realized that I never really explained how to do that.

Batman-Facepalm

There are actually a couple of ways of pushing data to a flow, however, I am going to share with you all my absolute favorite ways of doing this that you can also apply to all sort of other situations. In true “SFDCinSEA” fashion we are going to take the well documented idea of a pushing data in a URL (Best write up EVER!) , applying that notion to flows (From the Source!) and throwing in a bit of a curve ball by doing all this from a formula field (Evil laugh goes here!).

To do this, you will need the following:

  1. A flow
  2. A flow variable for the running user (varUserId)…What was actually asked about in the comments
  3. A flow variable for the accountid (VarPassedAccountID)…Just because I can
  4. A Hyperlink field

The basic premise is that we are going to use the hyperlink to launch the flow. When the user clicks on the hyperlink, it will pass over the accountID and running UserId.

Enough build up…here is what it looks like:

“Hyperlink(“/flow/validation_rule?varUserID=”&$User.Id&”&varPassedAccountID=”&Id,”Validation Rule Update”)”

No title can ever do the utility of this justice!

Sorry, you will need to click on it to see it in all of its weird font glory

Hmmm, that was really anticlimatic..wish there was a way to kick that up a notch, but there really isn’t…this is just a good use of the tools salesforce gives us!

Here it is sitting there looking awesome on the layout.

Yeah, that is pretty!

just want to smoosh it’s cute little URL

And here is proof that the values are passing!

bypass part two

MOAR BLURRING!

And yes, yes I am passing two values over to the flow.

Yes, yes I am

You can even use similar type of functionality if you decide to use a button.

One of the reasons I like doing this in a hyperlink field though is that I can change dynamically how this field is presented. For instance, I could use an image field to change how this looks based on some criteria. I could even “mask” the data by looking at the running user. Heck, I could even change which flow is actually running!

Enjoy, and keep the dialogue going!

Advertisement

2 thoughts on “WHAT CONDITION YOUR VALIDATION IS IN – Part 2

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s