2

I created a Visual Workflow that launches after a user clicks a custom button on the Account page. I'm wondering if I can use Decision logic to evaluate certain attributes for the logged in user and their associated user page. Specifically I want to evaluate if the user (who clicked the button) is also the Account owner. If they are then it should take them to an input screen. If the user is not the Account owner, then I want to show a fault screen. How do I go about evaluating the current user?

2

You should be able to use Global Variables for your scenario . Precisely you should be able to use {$!User.Id} to get the Id of the User executing the visual workflow.

Note that global variables are present in formula .So you can create a formula and assign to a variable

enter image description here

enter image description here

|improve this answer|||||
  • Hi Mohith, Thanks again for your resolution! Unfortunately, I need to compare the current user with the Account Owner Id. When I pull the Account Owner Id, I get the 18 digit id. When I use the Global Variable for User Id, I get the 15 digit id. As you can imagine, this means that if the Account Owner = the current user, it will still show the fault screen because it's comparing an 18 digit id to a 15 digit id. Is there a way turn the User ID from the Global Variables to 18 digits? Or vice versa, make the Account Owner ID return as 15 digits? Thanks so much! – Ruth Turaew Apr 20 '16 at 20:40
  • @RuthTuraew Can you put that as another question .Mention that 15-18 digits problem for flows .Thanks – Mohith Shrivastava Apr 20 '16 at 20:41
0

You need to pass them as parameters to the flow. You can use an extension controller.

<flow:interview name="FEPlacementRequest" finishLocation="{!EndPage}" interview="{!placementInterview}">        
    <apex:param name="UserName" value="{!$User.FirstName}"/>
</flow:interview>
|improve this answer|||||
  • Thank you for answering. I should have clarified to say I'm using the Cloud Flow Designer. I don't know Apex, but hopefully your comment will help someone who does know apex! – Ruth Turaew Apr 11 '16 at 2:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.