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
Melissa Driscoll 14Melissa Driscoll 14 

Visual force Page to show Opportunity Products

I am new to this but  I need to pull in the line times from the master relationship Opportunity. 

I am an admin not a developer but I don't have a developer

This is the error on the page
List attribute parent name 'o' is an invalid field name for entity Handoff

<apex:page standardcontroller="Handoff__c">
<apex:dataList value="{!Handoff__c.Opportunity__r}" var="o"> <apex:relatedList list="o.OpportunityLineItem" />
</apex:dataList>
</apex:page>

VinayVinay (Salesforce Developers) 
Try below snippet.

Page:
<apex:page controller="myOpptyController" tabStyle="Opportunity">
    <apex:pageBlock title="opportunity product related list">
    <apex:pageBlockTable value="{!opptyList}" var="div">  
          <apex:column >
                    <apex:pageBlockTable value="{!div.OpportunityLineItems}"  var="custom">
                    <apex:column value="{!custom.Quantity}"/>
                    <apex:column value="{!custom.UnitPrice}"/>
                    <apex:column value="{!custom.TotalPrice}"/>
                    <apex:column value="{!custom.PricebookEntry.Name}"/>
                    <apex:column value="{!custom.PricebookEntry.Product2.Family}"/>
                </apex:pageBlockTable>
        </apex:column>
       </apex:pageBlockTable>
</apex:pageBlock>  
</apex:page>

Controller:
public class myOpptyController {
    public List<Opportunity> opptyList;
    public myOpptyController() {
    opptyList = [SELECT Id,Name,Account.Name, 
                                  (SELECT Quantity, UnitPrice, TotalPrice,PricebookEntry.Name, PricebookEntry.Product2.Family FROM OpportunityLineItems) 
                        FROM Opportunity WHERE Id =: ApexPages.currentPage().getParameters().get('opptyID')];
       }
    public List<Opportunity> getopptyList() {
        return opptyList;
    }
}


Please mark as Best Answer if above information was helpful.

Thanks,