1

Can any one help me out ?I'm Creating an OpportunityLineItem(Opportunity Product) page in Visualforce page and now how should i call the related list(Schedule) fields to get display in Visual Force pages .Any Suggestions

Here is the Code :

<apex:page standardController="OpportunityLineItem" sidebar="false" showHeader="false">
    <apex:form>

        <apex:pageBlock title="Opportunity Product">
            <apex:pageBlockButtons location="Top">
                <apex:commandButton value="Edit" />
                <apex:commandButton value="Delete" />
            </apex:pageBlockButtons>

            <apex:pageBlockSection title="Opportunity Product Detail">
                <apex:inputField value="{!OpportunityLineItem.Opportunity.Name}" />
                <apex:inputField value="{!OpportunityLineItem.Product2.Name}" />
                <apex:inputField value="{!OpportunityLineItem.ProductCode}" />
                <apex:inputField value="{!OpportunityLineItem.ListPrice}" />
                <apex:inputField value="{!OpportunityLineItem.UnitPrice}" />
                <apex:inputField value="{!OpportunityLineItem.Quantity}" />
                <apex:inputField value="{!OpportunityLineItem.ServiceDate}" />
                <apex:inputField value="{!OpportunityLineItem.TotalPrice}" />
                <apex:inputField value="{!OpportunityLineItem.Description}" />
            </apex:pageBlockSection>
        </apex:pageBlock>

        <apex:pageBlock title=" Schedule">
            <apex:pageBlockButtons location="top">
                <apex:commandButton value="Edit" />
                <apex:commandButton value="Delete" />
                <apex:commandButton value="Re-Establish" />
            </apex:pageBlockButtons>
            <apex:pageBlockSection>
                <!--<apex:inputField value="{!OpportunityLineItemSchedule.Date}"/>-->
            </apex:pageBlockSection>
        </apex:pageBlock>

    </apex:form>
</apex:page>
2

Try using apex tag

<apex:relatedList>

Refer this documentaion for details.

  • :Thanks for your reply :I have used <apex:relatedList list="OpportunityLineItemSchedule__r"/> ,i would like the fields to get displayed in the related list object. – nikkey Oct 10 '14 at 11:54
  • @nikkey: You simply need to add those fields on page layout. Go to Opportunity product page layout -> Edit -> click Related List from left menu -> Find your custom object related list -> edit it and add required fields. Done :) – Aditi Jain Oct 11 '14 at 6:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.