3

I have created a flow on one of my environment and I am calling that flow on custom button by providing correct url. Now problem is when i click on the button,the url is referring Lightning url rather than salesforce url. I have checked the process automation setting and found that "Enable Lightning Runtime for Flows" is enabled.I have disabled the setting and flows now refer classic url.

But when I enable this option and run the flows in classic UI then it display below message: enter image description here

It is not returning url that was returned in classic UI.

I have to manually click on back button and see my changes.Not sure what needs to be done here..

  • Have you looked at the controller for your flow(s) to see what the finish URL is for them? – crmprogdev Jan 24 '17 at 18:50
  • @crmprogdev below are the url of the custom button: /flow/UpdateProductCompetitor?OpportunityId={!Opportunity.Id}&retURL=/{!Opportunity.Id} so when I click on button,ideally it just refresh the page navigate back to Opportunity record but If I checked "Enable Lightning Runtime for Flows" then it just display the message as Flow finished that I mentioned in my screenshot but do not navigate back to Opportunity record.I did not face this issue a month before.Looks like my org has installed Winter 17 updates that could be the reason it opens flows in lightning. – Dhananjay Patil Jan 24 '17 at 19:10
  • Might want to try adding "no override=true" to that retURL string. – crmprogdev Jan 24 '17 at 19:18
  • I've seen a few posts indicating that retUrl is not working in flows w lightning runtime enabled. Haven't dug into it yet but will update w links to success when I'm back at a desk. – gorav Jan 24 '17 at 20:00
  • 1
    @gorav So this is actually an issue.The only workaround I am able to see here is to create a VF page and call it in Custom Button which increases the design.But anyways I have raised a case with salesforce to see if there is any other workaround than VF & disabling the seeting 'Enable Lightning Runtime for Flows'.Will update you soon on this. – Dhananjay Patil Jan 25 '17 at 7:04
1

After raising the case with salesforce,instead of providing me the possible workaround they have just provided the bug number 'W-327172'.After doing some analysis I have found possible workaround that works both in classic as well as lightning.We need to create a VF page that calls visual flows and in VF we have to mention the return url.

<apex:page standardController="Opportunity" >
    <flow:interview name="Mention_Flow_Name" finishLocation="/{!Opportunity.Id}">
        <apex:param name="OpportunityId" value="{!Opportunity.Id}" />
    </flow:interview>
</apex:page>

In my requirement I have to create custom button on Related List Object not on parent object.In Current Salesforce Design,You can not call VF page when Button Type is List Button.So I have Used the below syntax and Bingooo,it works perfectly fine in my Case:

/apex/UpdateCompetitor?Id={!Opportunity.Id}&OpportunityId={!Opportunity.Id}

I have confirmed this syntax with Salesforce Tier 3 Agent.As per them,it is a valid syntax that you can use to solve this kind of requirement.

0

This is working as per Salesforce design. retURL won't work in Lightning Flow.

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.