+ Start a Discussion
NeetikaNeetika 

how to display Related List in visualforce?

Hello,

I want to create a visualforce page same as standard salesforce page..in that i want to display the related object list also..

 

I have tried <apex:detail relatedlist ="true"> but by this standard page is also displaying.i want to display visualforce related list.

and  <apex:relatedlist list="Order_Item__c"> this is also not working for me..

can anyone tell me the solution for this..?

 

kruti tandelkruti tandel

hi,

you need to change in page layout  to include related list.

shra1_devshra1_dev

Neetika,

 

You have to specify the plural name like, if your object Name is Order_Item__c then you need to give

 

<apex:relatedlist list="Order_Items__r"/>

 

 

Regards,

Shravan

NeetikaNeetika

Hi shravan..

Sorry i didnt mention i have tried that also..i.e. <apex:relatedList list="Order_Item__r"/>
 but it is giving error while saving the record.."'Order_Item__r' is not a valid child relationship name for entity Order"

 

thanks

NeetikaNeetika

Hi Kruti,

 

Yes it is included in page layout..then also it is not working..

 

thanks.

shra1_devshra1_dev

Neetika,

 

It should be Order_Items__r not 'Order_Item__r'.

 

And I hope you are mentioning the standard controller of its parent Object in that VF page.

 

 

Regards,

Shravan

kruti tandelkruti tandel

Hi ,

if you used detail tag in page then you can include relatated list using page layout. e.g

 

 

<apex:page standardController="Account">
<apex:detail subject="{!account.Id}" relatedList="true" title="false"/>
</apex:page>