I have a VisualForce page that has navigation which will return users to various views in the Salesforce native interface such as the Home tab, or to specific SObject records.
I have found that if I use window.open('/', '_self')
then the user is always taken back to the desktop version of Salesforce even if they are using the Salesforce1 app.
To stop this happening, I am refactoring those bits of code to something like the following:
if(typeof sforce !== "undefined" && sforce !== null) {
// Salesforce1 navigation
sforce.one.navigateToSObject(accountId);
} else {
// Desktop navigation
window.open('/'+accountId, '_self');
}
The above code using the navigateToSObject()
method works fine, but if I try to use to navigateToSObject()
method to return the user to the home page, then I get a:
The page you are trying to access is not supported on mobile devices
error.
I have tried all of the following and got the same error:
sforce.one.navigateToURL('/');
sforce.one.navigateToURL('/one/one.app');
sforce.one.navigateToURL('https://emea.salesforce.com/one/one.app');
sforce.one.navigateToURL('/001/e'); // I know this is not the home page
I'm not aware that I can make the home page accessible to mobile devices in the same way that I could make a visualforce page accessible. I would have thought that this is automatic.
I'd like to ask how other people would implement this and if there is anything that people can see that I am doing wrong here.
Thanks