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
Brian FerrariBrian Ferrari 

Case Clone With Visual FLow

I created a case clone using visual flow and a custom buttom.  How do I get the cloned case to display.  Obviously I need to get the clone case ID in the retURL=/{!Case.Id}.  I am not sure how I capture that in the Flow.
Best Answer chosen by Brian Ferrari
DavidGantDavidGant
Brian - To carry the created record Id to another flow step, you will want to assign the Id to a variable as part of the Record Create step (last option on the Record Create step config). That variable can then be referenced in other flow steps.

As far as getting the Case to display with the standard page layout, that will happen outside of the flow because flows don't leverage the page layouts. The code I linked to before should provide a good start towards passing the created record's Id as the finishlocation, which will cause the flow to display the new Case when you exit the flow. 

All Answers

DavidGantDavidGant
Brian - Here is a similar thread that may give some insight - https://developer.salesforce.com/forums/?id=906F000000097pVIAQ. It is working with Opportunities, but Cases should behave similarly.
Brian FerrariBrian Ferrari
David
Thanks for the response.  When I create the cloned case in the flow, is there a way to carry the record ID to another FLow step or to a URL in the custom button to simple display the cloned case in the standard case page layout I use?
Thanks
DavidGantDavidGant
Brian - To carry the created record Id to another flow step, you will want to assign the Id to a variable as part of the Record Create step (last option on the Record Create step config). That variable can then be referenced in other flow steps.

As far as getting the Case to display with the standard page layout, that will happen outside of the flow because flows don't leverage the page layouts. The code I linked to before should provide a good start towards passing the created record's Id as the finishlocation, which will cause the flow to display the new Case when you exit the flow. 
This was selected as the best answer
Brian FerrariBrian Ferrari
Thanks David