function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
jisakc1jisakc1 

calling workflow from a visualforce page command button

I have a visual force page with a custom controller and extension.  On the page I have a button that I want to call a workflow to collect some info and then send an email to a group.  When the workflow is done I want to return to the original visual force page that had the button.  Is this possible?  I can't seem to save a visualforce page with an embedded workflow.  I get an error that says  the tag <flow:interview> is unknown when I create it through the eclipse IDE or an error that the parameters I want to pass do not exist if I try to do it through salesforce.  It seems it wants me to create a new controller for the new page and then run all the same code again from the original page to set the parameters all in order to set the finish attribute.  Is that correct?  Seems like a lot of work for something that should be so simple.  Can you set the finish location in the workflow itself?  That seems the reasonable thing to do.
VikashVikash (Salesforce Developers) 
Hi,

Please follow these related links:
http://help.salesforce.com/HTViewHelpDoc?id=vpm_admin_add_flow_to_vfpage.htm&language=en_US
http://www.salesforce.com/us/developer/docs/pages/Content/pages_flows_adding.htm

Hope these links will help.

Thanks
Vikash_SFDC
BrokerBroker
It has been a few months since this post originated but I have been working on the same issue and have the following VF page successfully working to call Flows and custom Apex using an Apex:commandButton.  I created this to run as VF page on the Home page and added to Home layout. Here is a sample of the page: 

--------------------------------------------------
<apex:page >
<apex:pageBlock title="Quick Flows" >
 
   <apex:form > 
     <apex:commandButton action="/flow/Enter_Data" value="New Data" />
     <apex:commandButton action="/flow/EnterNewData" value="New Account" />
     <apex:commandButton action="/apex/UploadDocument" value="Attach Document" />
    </apex:form>
  
</apex:pageBlock>
</apex:page>
-------------------------------------------------

However, I have not been able to find how to set the Finish Location when using the commandButton.   I cannot figure out syntax that allows the standard finishLocation="{!URLFOR('/home/home.jsp')}" to work within the button action--whatever I try returns an error. 

If anyone can help improve the structure of the code here and/or add the finishlocation function, please share.   Thanks.