+ Start a Discussion
Aman wadhwa 18Aman wadhwa 18 

i want to create a vf page to show an opportunity record along with its opportunity line items can anyone help

ShirishaShirisha (Salesforce Developers) 
Hi Aman,

Greetings!

Please use the sample code provided below to create the VF page:
 
<apex:page standardcontroller="Opportunity">
<apex:pageblock title="Account">
<apex:outputlabel value="{!Opportunity.name}"></apex:outputlabel>
</apex:pageblock>
<apex:relatedlist list="OpportunityLineItem">
</apex:relatedlist>
</apex:page>

Reference:https://www.biswajeetsamal.com/blog/parent-record-related-list-in-visualforce-page/

Kindly mark it as best answer if it helps so that it can help others in the future.

Warm Regards,
Shirisha Pathuri​​​​​​​