Get related list without Action Column in visualforce page

G

Hi,

When you want to display related list on visualforce page, you can use <apex:relatedList>
tag, and it is very easy for ex:

<apex:page standardController="MyMasterObject__c">
	<apex:relatedList list="MyChildObjects__r" />
</apex:page>

but this will display all the columns from related list including “Action” column and many times
we don’t want to display this column.

so to access your related list in the visualforce page without adding columns such as “Action“;
for example to access your products from Opportunity Page then use <apex:repeat> or <apex:dataTable>
tags from visualforce. for example here is a code to access your Estimate products which is related list
on Estimate page from visualforce page:

<apex:dataTable value="{!Estimate__c.EstimateOrder__r}" var="eorl">
<apex:column headerValue="Product" width="10%">
<apex:outputText value="{!eorl.Product_Code__c}"></apex:outputText>
</apex:column>
<apex:column headerValue="Width" width="10%">
<apex:outputText value="{!eorl.Width__c}"></apex:outputText> </apex:column>
<apex:column headerValue="Height" width="10%">
<apex:outputText value="{!eorl.Height__c}"></apex:outputText> </apex:column>
</apex:dataTable>

This above code will display all your related list values on visualforce page without any column such as “Action
in a list.
To use <apex:repeat> replace <apex:dataTable> with <apex:repeat> and other fields are same.

Hope this will helpful for you.

Thanx.

 

 

About the author

prashant.wayal
By prashant.wayal

Category