I want to embed a visual workflow into a visual force page. I have overwritten the New button for a custom object that the user uses to select the next request they want to create. For a certain request to be created there are fields on the Opportunity that must have values before creating. I want to use the flow to determine if those fields have values before taking the user to the new request. Currently, they go to the new request, fill it out and on save the required fieldson the opportunity are checked and if they do not have values the user can't save their new request and must go back to the opportunity. You can see why they do not like this. Can I do what I am wanting to do with Flow? Are there any good examples to help me with this sort of thing? Much thanks to anyone that can shed some light on this!!!

3 Answers 3


From your description, it sounds like using Flow will solve the problem you describe. Here are a couple of resources to help you out: For information about creating Flows: http://www.snugsfbay.com For an example of a controller extension to pass an ID to a VF page: http://boards.developerforce.com/t5/Visualforce-Development/Passing-parameter-in-URL-to-a-visualforce-page/td-p/633619 Hope these help!


Write some Javascript:

    function theFlowIWantToCall(){ 
        window.location= '/flow/My_Flow';

Write a command button

<apex:pageBlockButtons >
   <apex:commandButton value="My Flow" onclick="theFlowIWantToCall(); return false;"/>

That will allow you to embed a flow into your page, but I'm not sure whether it can solve your larger problem, you'll have to experiment a bit.


This is definitely possible. I would pass in the value of the Opportunity ID you are basing the new Request on into the flow as a parameter, like this:

<flow:interview name="checkOppfields" >
      <apex:param name="oppid" value="{!Opportunity.id}"/>

Then, inside of the flow, you do a lookup on that opportunity, and include the fields you need. If they are populated, you go right to creating the request, if they are not, you could prompt with an in-flow screen asking for the missing data, then update the opportunity from inside the flow, and then proceed to create the request. This is a great use case for leveraging Flow.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .