• Femila Ice Cream
  • NEWBIE
  • 10 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 1
    Replies
<apex:page standardcontroller="Opportunity" extensions="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>

Class is as follows:
public class myOpptyController {

    public myOpptyController(ApexPages.StandardController controller) {

    }     

        public List<Opportunity> opptyList{get;set;}

       // public List<OpportunityListItems> opptyList1{get;set;}

        public myOpptyController() {
     

        opptyList = [SELECT Id,Name,

             (SELECT ID, Quantity, UnitPrice, TotalPrice,PricebookEntry.Name, PricebookEntry.Product2.Family FROM OpportunityLineItems)

                            FROM Opportunity WHERE Id =: ApexPages.currentPage().getParameters().get('ID')];

                  //   System.debug('opptyList ='+opptyList);

        }

         

      //  public List<Opportunity> getopptyList() {

      //      return opptyList;
    //    }
      

    }
This code is not displaying opportunitylineitem table
trigger total on Outlet_Billing__c (before insert, before update) {



if(Trigger.isBefore){
       decimal d;
        if (Trigger.isInsert || Trigger.isUpdate)

         {

           for(Outlet_Billing__c out : trigger.new)

         // try   {
             
out.Total__c= out.WaterCandyForm__c+
out.KulfiCandyForm__c+
out.DuetForm__c+
out.BabyChocobarFormula__c+
out.BigConeForm__c+
out.Butterscotch_1000mlForm__c+
out.Butterscotch_4Ltr_BulkForm__c+
out.Butterscotch_500mlForm__c+
out.CasattaForm__c+
out.Chocolate_1000mlForm__c+
out.Chocolate4LtrForm__c+
out.Large_Cup_ButterscotchForm__c;
}
 // catch (System.NullPointerException e) {
             
   //            }

           }

 }       
<apex:page standardcontroller="Opportunity" extensions="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>

Class is as follows:
public class myOpptyController {

    public myOpptyController(ApexPages.StandardController controller) {

    }     

        public List<Opportunity> opptyList{get;set;}

       // public List<OpportunityListItems> opptyList1{get;set;}

        public myOpptyController() {
     

        opptyList = [SELECT Id,Name,

             (SELECT ID, Quantity, UnitPrice, TotalPrice,PricebookEntry.Name, PricebookEntry.Product2.Family FROM OpportunityLineItems)

                            FROM Opportunity WHERE Id =: ApexPages.currentPage().getParameters().get('ID')];

                  //   System.debug('opptyList ='+opptyList);

        }

         

      //  public List<Opportunity> getopptyList() {

      //      return opptyList;
    //    }
      

    }
This code is not displaying opportunitylineitem table
trigger total on Outlet_Billing__c (before insert, before update) {



if(Trigger.isBefore){
       decimal d;
        if (Trigger.isInsert || Trigger.isUpdate)

         {

           for(Outlet_Billing__c out : trigger.new)

         // try   {
             
out.Total__c= out.WaterCandyForm__c+
out.KulfiCandyForm__c+
out.DuetForm__c+
out.BabyChocobarFormula__c+
out.BigConeForm__c+
out.Butterscotch_1000mlForm__c+
out.Butterscotch_4Ltr_BulkForm__c+
out.Butterscotch_500mlForm__c+
out.CasattaForm__c+
out.Chocolate_1000mlForm__c+
out.Chocolate4LtrForm__c+
out.Large_Cup_ButterscotchForm__c;
}
 // catch (System.NullPointerException e) {
             
   //            }

           }

 }