+ Start a Discussion
Suraj Maharjan 3Suraj Maharjan 3 

Display Related list on a visualforce page from managed package objects

I have two custom objects both form managed packages. 
I would like to create a visual force page using these objects where A is the master of object B. 
All I want to do is display related list. How do I achieve that in a visualforce page.
I have tried using 
<apex:page standardController="MyMasterObject__c">
<apex:relatedList list="MyChildObjects__r" />
</apex:page>
 
Best Answer chosen by Suraj Maharjan 3
Suraj Maharjan 3Suraj Maharjan 3
So I finally figured it out, the child relationship was wrong and it was not properly exposed in Schema Builder.
I had to go to workbench and find the actual child relationship name

All Answers

Lokesh KumarLokesh Kumar
Suraj,

Are you able to access it on record detail page if yes then your above code is correct Only you have to do something in the URL?

For this page to display the related list data, the ID of a valid custom object record with a custom relationship must be specified as a query parameter in the URL for the page, for example, http://na3.salesforce.com/myCustomRelatedList?id=a00x00000003ij0.

for your knowledge, you can refer this link
 https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_quick_start_custom_mapping.htm

Thanks 
Lokesh

Suraj Maharjan 3Suraj Maharjan 3
It works perfectly fine for the custom objects that I created but not for the managed package. I can see them in record detail page as a related list. I need to get it working on the visualforce page.
Note: Both custom objects A and B are from managed package.
Suraj Maharjan 3Suraj Maharjan 3
So I finally figured it out, the child relationship was wrong and it was not properly exposed in Schema Builder.
I had to go to workbench and find the actual child relationship name
This was selected as the best answer
Stephen Long 6Stephen Long 6
You need to put the prefix of the managed package at the beginning. So for Financial Force Accounting package it would be c2g__MyCustomObject__r