[SalesForce] How to redirect to a Custom Object Tab in Salesforce1 from a Visualforce Page

I've a Visualforce Page with a Save and Cancel button. When used in Salesforce1 the button "Cancel" needs to redirect user to the Custom Object Tab list view in Salesforce1. Now I have deduced that the URL for custom Tabs Lists in Salesforce is in this format:

/one/one.app#/sObject/MyObject__c/home

But when I try to use this in sForce.one library i get error that page cannot be shown as it is not mobile supported a general error from S1 when a VF page or interface is not ready for mobile. But all I'm trying to redirect user is to the same URL from where the user came across in S1 app.

I've tried URL Encoded as well as direct URL value for redirect, and I get same message always:

sforce.one.navigateToURL("%2Fone%2Fone.app%23%2FsObject%2FMyObject__c%2Fhome");

sforce.one.navigateToURL("/one/one.app#/sObject/MyObject__c/home");

Can someone guide me how to guide user to a List View url in Salesforce1?

Best Answer

To send users to the home tab of a custom object the format is this:

sforce.one.navigateToURL('#/sObject/Custom_object__c/home');
Related Topic