• Vimarsh Saxena
  • NEWBIE
  • 5 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 5
    Replies
I am a newbie to Salesforce and just started to work with Flows. My flow is creating a record and I want to navigate to the new created record when the flow finishes. I read this can be done by adding a retURL parameter here https://help.salesforce.com/articleView?id=vpm_url_set_retURL.htm&type=5 but I can't edit the flow URL to add the parameter. Please help
I am a newbie to Salesforce and just started to work with Flows. My flow is creating a record and I want to navigate to the new created record when the flow finishes. I read this can be done by adding a retURL parameter here https://help.salesforce.com/articleView?id=vpm_url_set_retURL.htm&type=5 but I can't edit the flow URL to add the parameter. Please help

I've built a Flow that creates a new record for a Custom object. I'm setting a variable to the new id in the Flow, but I think my VF page is reading its value at creation, which is null. How do I set a page reference to the new id so I can redirect to the new Dispatch__c object? 

 

Controller:

public class DispatchFlowController {
	
	public Flow.Interview.New_Dispatch_Flow theFlow {get; set;}
		
	public PageReference getNewDispatchRecord(){
		if(theFlow == null)
			return null;
		else
			return new PageReference('/' + theFlow.NewDispatchId);
	}
	
}

 VF Page:

<apex:page Controller="DispatchFlowController" >
<flow:interview name="New_Dispatch_Flow" interview="{!theFlow}" 
	finishLocation="{!NewDispatchRecord}"/>
</apex:page>

 note, if I hard-code the new PageReference to an existing id it does redirect to that object instance, but obviously I don't know what id my new object will have until the end of the Flow.

We have created a flow that creates an Opportunity and we want the "finishlocation" of the flow, where they end up when they click "Finish", to be the newly created Opportunity. I know that we will have to create a VF page and controller to pass the OpptyID (once created) back to the VF page and set as the finishlocation, but can't figure out how to do it. Any ideas?