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
nagalakshminagalakshmi 

Displaying related products in vf page based on opportunity look up value

Hi,

 

Actually i have a custom object with name order and i have a look up field with opportunity object in custom object. Now my requirement is displaying related list of products based on opportunity look up value with out using controller. Please any one help me for solving the issue.

 

Thanks,

Lakshmi.

Devendra@SFDCDevendra@SFDC

 

Hi nagalakshmi,

 

You need to use <apex:relatedList> on visualforce page.


Please refer following blog from Jeff Douglas:

 

http://blog.jeffdouglas.com/2009/05/13/using-related-lists-in-visualforce-pages/

 

Hope this helps.

 

Thanks,

Devendra

nagalakshminagalakshmi

Hi devendra,

 

Thanks for your reply. But i am using standard controller as custom object. I am wrote like this

 

<apex:page standardController="Order" renderAs="pdf" showHeader="false" sidebar="false">
<html>
<head>
<style type="text/css">
.tdgeneral
{

text-align=center;
height:20px;
width:400px;
}
</style>
</head>
<body>

<apex:form>

<apex:outputText>

<table border="0.1" cellspacing="0" cellpadding="0">
<tr>
<td class="tdgeneral">Topland Sales Contact</td>
<td class="tdgeneral">{!Order__c.Opportunity__r.owner.name}</td>
</tr>
<tr>
<td class="tdgeneral">Customer Name</td>
<td class="tdgeneral">{!Order__c.name}</td>
</tr>
</table>

</apex:form>

</body>
</html>
</apex:page>

 

How can i display the products lists based on look up id of custom object. Please help me.

 

Thanks,

Lakshmi.

Devendra@SFDCDevendra@SFDC

 

Hi,

 

Please check,

<apex:page standardController="Order" renderAs="pdf" showHeader="false" sidebar="false">

 

It must be Order__c instead of Order.


After displaying Order detail you can write below code:

 

<apex:relatedList subject="{!Order__c}" list="Opportunities__r" />

 

Opportunities__r : is the relationship name wit Order__c. Please check relationship name in your Data Model.

 

Hope this helps.

 

Thanks,

Devendra

AasifAasif

I think, You should write a controller to achieve this.

nagalakshminagalakshmi

Hi devendra,

 

i am using the tag

 

<apex:relatedList subject="{!order__c.opportunity__C}" list="OpportunityLineItems"/>

It will displays the opportunity line items perfectly. But it will display the column with action name. Its having edit and delete. Those functionalities i did not want to display. How can i remove the edit and delete from related list. Please help me.

 

Thanks,

Lakshmi

 

 

 

nagalakshminagalakshmi

Yes aasif, 

 

But it is professional edition. So there is no classes. Because i am want to display all things with out using controller.

 

 

Devendra@SFDCDevendra@SFDC

 

Hi nagalakshmi,

 

This is standard related list and you can not able to remove those actions. These actions will be visible to user based on profile CRUD permissions on that object.

 

Suppose you have create a profile "Test Profile" and the object you are displaying in related list is "Order".

 

For Order object, you have set permission as (Read is true and others are False). Then Edit/Delete actions will not be there. Because that profile has not given those permissions.

 

*If you want to remove those links then you will have to use VF/Apex code to display only the list of items and No Action

 

Hope this helps.

 

Thanks,

Devendra