2

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!!!

1

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!

| improve this answer | |
0

Write some Javascript:

<script>
    function theFlowIWantToCall(){ 
        window.location= '/flow/My_Flow';
    }
</script> 

Write a command button

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

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.

| improve this answer | |
0

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}"/>
</flow:interview>

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.

| improve this answer | |

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.