You need to sign in to do that
Don't have an account?

How to redirect to new record that a Flow just created?
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.
Resolved. All I needed was a finish screen in the Flow. Ending on the RecordCreate step was not working.
All Answers
Resolved. All I needed was a finish screen in the Flow. Ending on the RecordCreate step was not working.
Show me your code i can handle it .
Regards,
Harish.R
Hi crowcoder@gmail.com,
I tested this for my own requirements and it worked great. However, in my flow, and button, I assign flow variables. How do I assign variables within the controller or VF page? Currently I do that in the button url, but can't replicate that with a visual force page.
Thanks,
Kory
Hi,
My VF page still doesn't redirect to the new record created by flow. Here is my VF Page and Controller:
VF Page

Controller

Can someone assist please
Thank You!