0

Controller:

public with sharing class Opportunity_DAQuoteCtrlExt {

private final Opportunity rhOppty;
Opportunity thisOppty = new Opportunity(); 


public Opportunity_DAQuoteCtrlExt(ApexPages.StandardController stdController){
    this.rhOppty = (Opportunity)stdController.getRecord();
    }

public List<Design_Atelier_Quote__c> daQuoteList{
    get{
        if(daQuoteList == null){     

                System.debug('Oppty Id: ' + this.rhOppty.Id);       

                thisOppty = [SELECT Id, Oppty_Number__c FROM Opportunity where Id = :this.rhOppty.Id]; 

                System.debug('Oppty Number: ' + thisOppty.Oppty_Number__c);              

                List<Design_Atelier_Quote__c> daQuoteList = [SELECT EXT_Oppty_Number__c, Quote_Id__c, Forecast__c, Order_Subtotal__c, Quote_Forecast_Amount__c from Design_Atelier_Quote__c WHERE EXT_Oppty_Number__c =:thisOppty.Oppty_Number__c];

            }               
        return daQuoteList;
        }
    set;        
   }
}

daQuoteList returns:

{EXT_Oppty_Number__c=Z160523-146681, Quote_Id__c=qU0T31d1,Forecast__c=true, Order_Subtotal__c=100000.00, Quote_Forecast_Amount__c=100000.00, Id=a1rQ0000001hbPAIAY, CurrencyIsoCode=USD}

VF Page:

<apex:page standardController="Opportunity" extensions="Opportunity_DAQuoteCtrlExt">
    <apex:form >
        <apex:pageBlock mode="detail">
            <apex:pageBlockSection columns="1">
                <apex:pageBlockTable value="{!daQuoteList}" var="daQuote">
                    <apex:column headerValue="Quote" value="{!daQuote.Quote_Id__c}"/>
                    <apex:column headerValue="Subtotal" value="{!daQuote.Order_Subtotal__c}"/>
                    <apex:column headerValue="Forecast" value="{!daQuote.Forecast__c}"/>
               </apex:pageBlockTable>   
            </apex:pageBlockSection>
        </apex:pageBlock>
    </apex:form>
</apex:page>

Result: the table renders with the column headers but no data. What am I doing wrong??

Thanks!"

2

You are assigning the query results to a local variable not the property of the same name:

List<Design_Atelier_Quote__c> daQuoteList = [SELECT ...];

Removing the type part will stop the line being a new declaration and just make it an assignment to the existing property:

daQuoteList = [SELECT ...];
| improve this answer | |

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.