I am new in salesforce and I'm trying to make a call from a visualforce page inside salesforce1 (now called lightning, I think) to a Related List of contacts. My page show some options related to the Account object and one of this options is to show its Contacts (that's what I want but this code is not working):

<apex:outputPanel > 
        <a href="sforce.one.navigateToRelatedList('Contacts', '{!idAccount}');"> 
        <input type="button" value="Contacts" class="register-button"/>

I just want to show this: Is the same that you can see in Salesforce Lightning under Accounts/Related/Contacts

Account salesforce

and then

enter image description here

<a href="sforce.one.navigateToRelatedList('Contacts', '{!idAccount}');"> 

This code isn't executing the JavaScript but instead trying to navigate to an invalid URL.

try href="javascript:sforce.one.navigateToRelatedList('Contacts', '{!idAccount}')"

  • Oh Thanks a lot. I didn't know that. Now it works perfectly.
    – MANUELAN00
    May 11 '15 at 4:47
  • Glad to help. :)
    – Kris Gray
    May 11 '15 at 4:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.