You know who likes innovating? I like innovating.

Standard

You know who likes innovating? I like innovating.

This-Guy-Jim-Halpert-The-Office.gif

NOTE – Not actual salesforce admin writing blog.

Thus, when I saw that Salesforce Seattle was hosting an app innovation workshop, I decided to sign up.

The class was pretty neat, the group brought out a SE that showed us how to build out some apps and how the new lightning interface was going to make app building EPIC.

And then, just like that, it was our turn to build an app. We separated out into teams and planned (And ate tacos!). We had 2 hours to build out an app that was mobile, had some business value and used the lightning interface….and had a clever name.

No problem.jpg

NOTE – Not actual blog writer.

My team (Fairy Godmothers) decided to tackle a problem that is all too familiar to sales teams (and ghost busters) …you know what I am going to say here, “Who ya Gonna Call”?

ghostbusters6.jpg

NOTE – Not actual team photo

Being that I have never done sales, this is all anecdotal, but the nods of both the AE’s and SE’s in the room told me that I was on to something. I have noticed that a salesperson will get on a call that should not require a technical resource and then BAM! The potential customer brings a nerd along and the hard questions start to flow. The salesperson then is left scrambling for resources, vowing to never let this happen again! The next call the salesperson goes on they invite the SE and the SE just listens in and play angry birds. On a side note, I once worked at a large company that the meetings would get so large because of this phenomenon, it would take like 10 minutes to do introductions.

Being that we only had two hours, I decided to keep this simple. No custom objects, just using the functionality Benioff gave us! So flows were used…because…well…I love flows. But seriously, using flows also gives me the ability to create advanced, code like (Dare i say, low / no code?) functionality without worrying about things like UI and, well, code.

The flow itself is not anything spectacular (two hours!). Screen Shot 2016-12-21 at 10.17.40 AM.pngIf it is launched via the app, it just pulls up a list of the users open opps. The user selects one and then is presented with a list of current active users and a selection around communication methods. Selecting email will send an email, but selecting text sends out an email using the email to phone number “hack” (is it a hack any more after it has been around as long as this one?).

However, there is one bit of fun that I want to call out (as I have done before). I pass a variable to the flow which is then analyzed. This variable is ONLY populated when a flow is launched from a record, so if this variable is populated, we would know that the flow started from a specific record. By doing this, I can build out decisions that adjust the functionality. In this case, I have two start screens, one for when the flow is launched via the app (and shows all opps) and one for when it is launched via record (and just goes right to the fairy godmother selection).

Screen Shot 2016-12-20 at 9.15.09 AM.png

“And then the running back goes around the TE..BOOM!”

By doing this, you can avoid using two flows what is essentially the same functionality.

To get this working on the individual record, you have to use a visualforce page

NOOOOO.jpeg

NOTE – this is the blog author writing code (just kidding).

because the button URL hack just won’t work as expected. You can place a flow on the record page layout, but I wasn’t able to figure out how to pass a value. If you know now, shoot me a tweet (@jok3r4o2) OR send me a message through the success community. If you are local to Bellevue, I will buy you a coffee.
Anyways, not a huge deal to create a VF page. I have documented it a few times AND by doing a VF page on a button, it allowed me to make it mobile really easy by just adding an action!

<apex:page standardController=”Opportunity” showHeader=”false” sidebar=”false” >
<flow:interview name=”life_ring”>
<apex:param name=”varSourceOppId” value=”{!Opportunity.Id}”/>
</flow:interview>
</apex:page>

Alrighty, so that is the nuts and bolts of my two-hour build. Pretty dang happy with this app and will probably put into production. But, how I would I make it better? Well, cue the Scooby Doo transition!

giphy

 

  • Show users that are logged-in. I found a really cool table when building out the flow called “AuthSession”. https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_objects_authsession.htm This is the table that shows who is logged in and how. Now, it wouldn’t be as straightforward as just using this as a dynamic lookup, but still, the idea that you could see who was logged in before you contacted them is pretty great.
  • Finding Relevant Users. Using the power of flows, we could do some data crunching to build out a profile of a specific opp (product, competitor, etc…) and then use this information to pull only fairy godmothers who have had experience in these areas.
  • Gamify! This type of app lends itself to gamification. I would have built this out so that Fairy Godmothers got credit or went up a lead board (AKA, Dashboard) for the help that they do. If you go down the gamification path, brush up on Maslow’s Heirarchy of Needs to figure out how to reward employees.
  • Communicate in multiple ways. I am using email and text, but it would be a good next step to also post in chatter. You could also use a service like Zapier or IFTTT to post to slack.

And that my friends is that! As I said, be sure to check out an app innovation workshop. I came away excited for Lightning UI and all the neat things it can do along with a great app idea and a couple Starbucks Gift cards.

As always, did I miss anything? Do you have a great idea for an app and just need a bit of help? Find me on success.salesforce.com and drop me a line!

Dynamic Screens using Visualforce and Flows

Standard

 

Oh boy, do I have something real nice for you all today!

Real nice.jpg

Something Real Nice!

Let’s say, you find myself in the world of action adventure blockbuster “Pacific Rim”. You are tracking Kaiju in an object called “Kaiju” and and tracking Jaegers with an object called “Jaeger”. From the detail page of Kaiju, I create a new detail button called “Dispatch Jaeger” that runs a flow by calling a Visualforce page. I know this is not typical, but stick with me! This flow associates the selected Jaeger to the Kaiju so then the whupping can commence!

Kaiju vs Jaeger

That works pretty well, but a user will always have to be on a Kaiju detail page to dispatch a Jaeger, so it might be good to put something on the home page that allows someone to either dispatch a Jaeger on an existing Kaiju OR create a new Kaiju and Dispatch a Jaeger all at once.

The first place I went is the google verse because I thought I would just create a small Visualforce page with an input box on do some sort of URL hack to get it to push a value to the already created Visualforce page that launches my flow. Turns out, there is really no such thing as “small” when it comes to this type of stuff. Most of the articles I read involved some sort of controller, so my overhead went pretty quickly from one Visualforce page to Visualforce page + controller + tester.

Back to the drawing board I went!

2015-12-09 15_45_16-pacific rim whiteboard - Google Search.png

I remembered some early work I did with flows where I used a decision element as my starting point, which would then direct a user to certain pages. I decided to explore the option of using this, and it worked!

Here is what I did! I modified my dispatch Jaeger flow so that the starting element is a decision.

Flow Overview

Starting Decision

This decision checks to see if KaijuId is being passed over from the Visualforce page, which it would be if you were launching it from Kaiju Detail. If this value does not start with the prefix for the Kaiju record (This works WAAAY better than checking for null or not null), it redirects to the newly created “quick dispatch” screen element.

I added my Visualforce page to my home screen and boom, my flow correctly presented me with the quick create screen!Home Page

However, I still needed the ability to create a dispatch from the detail screen, so let’s click the button and see what happens!

Dispatch from Record Yep, the flow determines that I am running a dispatch from a record detail and points me to the right screen!

To sum it up…I was able to with Zero Extra Code, modify my flow so that two different screens are presented to the user based on if they were dispatching a Jaeger from a specific Kaiju, or were having to dispatch a Jaeger from the home page via a quick create function.

Dispatch jaeger VF code
You might also be wondering why I am using a visualforce page? Well, if you want to run flows in a community, you have to wrap that flow in a visualforce page…That being said, you can totally do this same type of thing with a URL launched flow too…the functionality is really the same with the novelty part of this being that it works within Visualforce.

So, that wraps this post up! Thanks for checking it, comments / questions are always appreciated.
Also, quick note, I will be at the Salesforce World Tour in Seattle on the 17th. I would be more than happy to talk about flows or other Salesforce awesomeness, just look for this guy:

Salesforce in Seattle!

I am smiling because I support Salesforce

The hot fudge for your visual flow sundae

Standard

Flows really are a ground breaking piece of technology.

were not worthy

It was evident last year at DF14 by how often there were talked about. More stuff is being added every release and there is a great big community of users!

UI based flows are awesome for internal user, just pop the URL into a button and instant awesome! A question that is constantly being asked is, how do I get the pop up window to go away”

See, when you launch the UI version of the flow, it does it’s merry little thing and then takes you back to the start, which is not always ideal! Being that we are all really clever folks in this community, there are a bunch of ways around this, but a lot of them require visualforce / apex or a URL hack…but not many of them actually address the needs I had:

  • I need this to run with in a community
  • I would like the window to close once the flow is completed

First things first, we need the flow to run in a community. According to page 115 of the Visual Workflow Guide:

“Enable external users to run your flow by adding the flow to a Visualforce page and distributing that page through a Force.com site, Customer Portal, or Partner Portal.”

OK, no big deal there. This topic has been covered extensively on this blog and others! As a side note, this is how you get flows playing nicely with Salesforce1, so head over here to learn more…I will wait!

Ah, you are back! Now that we have a flow that will run on communities or internally. How the heck do we get the flow to close out the window? Well, after googling various iterations of “closing visualforce window” I finally just decided to google something like “close browser window javascript” (This was after googling “Moscow Mule Recipes”).

I wish this just came from one source, but I was really using the google hive mind that day! What I ended up doing is using some javascript in a visualforce page called “ForceClose”:

<apex:page showChat=”false” showHeader=”false” sidebar=”false” applyBodyTag=”false” applyHtmlTag=”false”>
<html>
<head>
<title>ESCAPE</title>
<script>
function closeWindow() {
window.open(”,’_parent’,”);
window.close();
}
</script>
</head>
<body onload=”closeWindow()”>

</body>
</html>
</apex:page>

NOTE! If this code looks familiar to someone, please let me know so I can give you a hat tip from little corner of the web!
NOTE + 1! I still have my #ClicksNotCode card, so I would imagine this is not near good code!

Now I have a flow that runs in a Visualforce page AND a Visualforce page that should (in theory) close itself. It is time to…wait, I wish this step could be more dramatic…maybe you could read this in a monster truck voice? Just in your head so you are not disturbing your neighbor! OK, carry on…join the two pages together! Just set your finish location on your flow visualforce page to be the forceclose page!Add Finish Location

And, that is that! So, how does it work? Well, pretty darn good! The super sweet thing though is that this is reusable! I now used the “ForceClose” page 5 or 6 times in various flows, and that is really nice!

As always, thanks for reading the SFDCinSEA blog! If you have any questions or comments, let me know!