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
krishivkrishiv 

Re:

how to get the field values  of the product related to a particular opportunity

in  a visual force page ?the controller used for the visual force page is the standard controller(opportunity).

i find errors when  tried out this way.....

 

<apex:page standardcontroller = "opportunity">

<apex:outputfield value="{!opportunity.name}"/>

<apex:outputfield value="{!opportunity.product2.name}"/>

</apex:page>

hisrinuhisrinu

For one opportunity you can have more than one products... for this you have to write something like this

 

<apex:page standardcontroller = "opportunity">

<apex:outputfield value="{!opportunity.name}"/>

<apex:pageblocktable value="{!opportunity.OpportunityLineItems}" var="o">

<apex:column value="{!o.Decsription}"/>

</apex:pageblocktable >

</apex:page>

 

Opportunity and Products are not directly related so you might need to some more work around in order to bring these products to the vf page.