• Miriam Gutiérrez
  • NEWBIE
  • 0 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 2
    Replies
Hey everyone,

we have a flow which we invoke by a Visualforce page to redirect it to an opportunity record after the flow finishs:
<apex:page standardController="Opportunity">   
    <flow:interview name="Opportunity__Flow" finishLocation="/{!Opportunity.Id}">
        <apex:param name="recordId" value="{!Opportunity.Id}"/>
    </flow:interview>   
</apex:page>

Now, this does not work in the Salesforce mobile app. Salesforce hinted me to:
https://developer.salesforce.com/docs/atlas.en-us.salesforce1.meta/salesforce1/vf_dev_best_practices_navigation.htm

Now my Visualforce page looks like:
<apex:page standardController="Opportunity">   

    <flow:interview name="Opportunity_Flow" finishLocation="sforce.one.navigateToSObject(\'' + {!Opportunity.Id} + '\')';">
        <apex:param name="recordId" value="{!Opportunity.Id}"/>
    </flow:interview>
    
    <script type="text/javascript">
        function getRecordURL() {
            var recordURL = 'sforce.one.navigateToSObject(\'' + '{!Opportunity.Id}' + '\')';
            return recordURL;
        }
    </script>   
</apex:page>

I tried it both as a function and dirctly in the finishLocation-parameter. Both lead to the error:
Invalid Page Redirection
The page you attempted to access has been blocked due to a redirection to an outside website or an improperly coded link or button. Please contact your salesforce.com Administrator for assistance. For more information, see Insufficient Privileges Errors. 

Click here to return to the previous page.

Does anyone have experience with flow redirections in the Salesforce mobile app? 

Kind regards,
Gleb

 
Hello All,
     I'm stuck in the middle of this problem I don't know how check from which source user page extrated. If I open user page first in salesforce classic and after I switch it to Lightning.
Thanks to all of you in advance

Regards'
Taresh Pandey