7

How do I redirect from an iframe back to salesforce1 mobile mode?

My redirect links are using baseURL/apex/VF page name. which takes me to the "not mobile" url. (even when I am in mobile mode)

What can I use in salesforce1 to redirect to the VF page from the Iframe?

2 Answers 2

4

If you are in the visualforce iframe in salesforce1 and want to navigate to another visualforce page you can use the Salesforce1 Navigation API.

To redirect to another page named MyPage you would use this Javascript:

sforce.one.navigateToURL('/apex/MyPage')

So if you wanted to redirect to another page on a button click, you'd do something like:

<button onclick="sforce.one.navigateToURL('/apex/MyPage');">Redirect to My Page</button>
2
  • This is not the situation. I am inside salesforce1 iframe, using differenet application that is doing redirect to sales force. how can I redirect to salesforce1? is there any url from outside of salesforce that is leading to salesforce1 VF page?
    – Efrat
    Commented Dec 30, 2013 at 8:30
  • This is not currently supported in the current release. Can't say anything about the next release, but I'm guessing you'll be happy.
    – Kris Gray
    Commented Jun 23, 2014 at 19:09
3

I think I can help here.

The premise: You're in Salesforce1 which has a VF page, and on that VF Page you have an iframe. That iframe wants to redirect to a VF page and see the mobile version, but it doesn't have access to the sforce.one API.

If that is the case you can built the URL as such when doing the redirection

/apex/mypage?isdtp=p1

It is a URL hack and there are no guarantees it'll continue working release to release, so just keep an eye on it.

If that is not what you were looking for let me know and we can figure out the proper solution.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .