function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Madhanprabhu Thangadurai 1Madhanprabhu Thangadurai 1 

sforce.one.navigateToRelatedList is not working.

Hi Guys,

I'm trying to implement the basic Salesforce1 navigation in my Developer Org. I'm using the following code snippet to navigate from a Command Link to Related List of a Custom Object. I have hard-coded the Related List ID and Parent Record ID in the javascript.

<apex:page showHeader="false" > 
<script type="text/javascript"> 
function navigateToList() 

     if( (typeof sforce.one != 'undefined') && (sforce.one != null) ) 
     { 
          sforce.one.navigateToRelatedList('00N9000000DQ4yq','a049000000WQcOO'); 
     } 

</script> 
<apex:form > 
     <apex:commandLink value="Navigate to link" onclick="navigateToList();"/> 
</apex:form> 
</apex:page>

But when i try to click on the Command Link ( Navigate To Link ), i'm getting the following Error. Your helps are highly appreciated. Thanks in advance.

User-added image
Best Answer chosen by Madhanprabhu Thangadurai 1
Madhanprabhu Thangadurai 1Madhanprabhu Thangadurai 1

I got solution from the following link

https://help.salesforce.com/apex/HTViewSolution?id=000206740&language=en_US (https://help.salesforce.com/apex/HTViewSolution?id=000206740&language=en_US)

You need to mention your API name instead of related List ID.

For Standard Case Object -  sforce.one.navigateToRelatedList('Cases','{!Account.Id}');

For Custom Object (eg - MyCustom__c) - sforce.one.navigateToRelatedList('MyCustom__r','{!Account.Id}');