+ Start a Discussion
DHO_604DHO_604 

Calling visual workflow from VF page

Hi,

 

Could you please shed some light on calling a visual workflow on a VF Page?  Ideally I'm looking to add a button on the VF page to invoke the visual workflow.  Is there a way to call it like using a custom button by setting the content source = 'URL' and then just type in the URL of the flow, or would I have to write a controller and invoke the method there?

 

TIA

 

D

NevurothNevuroth

You can call a visual workflow on a page with the tags below. However it stands to mention that it may be hard to just render the visual workflow on the page itself without losing the current form data (assuming the page does something besides call the visual workflow).

 

Possible solutions are to place it inside of an apex:outputPanel or to contain it in an entirely different visualforce page and have the button take you to the page that hosts the flow instead.

 

If you need to remain on the page until the flow is complete then attempting to render the flow separately in a outputpanel is probably your best bet, never done it myself however so I can't say it's a surefire solution.

 

<flow:interview name="MyFlow" finishLocation="{!$Page.ThankYouPage}">
  <apex:param name="MyParam" value="MyValue"/>
 </flow:interview>