You need to sign in to do that
Don't have an account?
Charles McDowell
Controller Extension Query child and a child of the child
I have have four objects 1:Project__c 2:Child - Quote__c 3: Child: QuoteDetail__c 4:Child: QuotePrice__c
here is my code. I get an error the q.ID is not recognized. Can someone tell what I am doing wrong? Thanks
here is my code
public class ProjectRptExtension {
Public List<Quote__c> q {get;set;}
Public List<QuoteDetail__c> qd {get;set;}
Public List<QuotePrice__c> qp {get;set;}
Public ProjectRptExtension(apexPages.StandardController controller){
Set<ID> setQDid = new Set<ID>();
ID MyId = apexpages.currentPage().getParameters().get('id');
// Project__c = (Project__c)controller.getRecord();
q = [Select ID, Name, System__c, Coverage_Area__c, System_Price__c, Project__c From
Quote__c Where Project__c = : MyID limit 1];
qd = [Select Name, Product__c, Product_Category__c, Order_In_System__c, Product_Total__c,
Coverage_Density__c, Quantity__c From QuoteDetail__c
Where Quote__c = : q.Id];
For (QuoteDetail__c qdt: qd){
setQDid.add(qdt.id);
}
qp = [Select ProductSizePrice__c, Quantity__c, List_Price__c, Ext__c
From QuotePrice__c Where QuoteDetail__c in : setQDid];
}
}
here is my code. I get an error the q.ID is not recognized. Can someone tell what I am doing wrong? Thanks
here is my code
public class ProjectRptExtension {
Public List<Quote__c> q {get;set;}
Public List<QuoteDetail__c> qd {get;set;}
Public List<QuotePrice__c> qp {get;set;}
Public ProjectRptExtension(apexPages.StandardController controller){
Set<ID> setQDid = new Set<ID>();
ID MyId = apexpages.currentPage().getParameters().get('id');
// Project__c = (Project__c)controller.getRecord();
q = [Select ID, Name, System__c, Coverage_Area__c, System_Price__c, Project__c From
Quote__c Where Project__c = : MyID limit 1];
qd = [Select Name, Product__c, Product_Category__c, Order_In_System__c, Product_Total__c,
Coverage_Density__c, Quantity__c From QuoteDetail__c
Where Quote__c = : q.Id];
For (QuoteDetail__c qdt: qd){
setQDid.add(qdt.id);
}
qp = [Select ProductSizePrice__c, Quantity__c, List_Price__c, Ext__c
From QuotePrice__c Where QuoteDetail__c in : setQDid];
}
}
Quote
QuoteDetail
QuotePricing
But I get QuoteDetail nested but the Quote Pricing is not nested. Here is my markup and thanks for your help
<apex:page standardController="Project__c" extensions="ProjectRptExtension" >
<apex:form >
<b>{!Project__c.Name}
<apex:pageBlock >
<apex:pageBlockTable value="{!q}" var="g">
<apex:column value="{!g.name}" />
<apex:column breakBefore="true" colspan="2" >
<apex:pageBlockSection Title = "Products" columns="1">
<apex:pageBlockTable value="{!qd}" var = "d">
<apex:column value="{!d.name}" />
</apex:pageBlockTable>
</apex:pageBlockSection>
</apex:column >
<apex:column breakBefore="True" colspan="2" >
<apex:pageBlockSection title="Pricing" columns="1">
<apex:pageBlockTable value="{!qp}" var = "p">
<apex:column value="{!p.ProductSizePrice__c}" />
</apex:pageBlockTable>
</apex:pageBlockSection>
</apex:column >
</apex:pageBlockTable>
</apex:pageBlock>
</b>
</apex:form>
</apex:page>