You need to sign in to do that
Don't have an account?
Allan Noland
How can you create a subtable of a set of child records IE a pageblocktable inside of another pageblock table
Hi,
I am pretty new to Salesforce development and for that matter development in general. Can somebody help the rookie out? I have a child object of the system object opportunity. it is revenueProjection__c. I want to create a page where the revenue projection can be easily edited by the sales folks. I am trying to use the __r notation to traverse to the child relationship but no matter how i try it it doesn't work. In reading all of the documentation i can find on the subject it seems like i am doing it correctly. Of course it always does :) Here is my code what am i doing wrong?
I am pretty new to Salesforce development and for that matter development in general. Can somebody help the rookie out? I have a child object of the system object opportunity. it is revenueProjection__c. I want to create a page where the revenue projection can be easily edited by the sales folks. I am trying to use the __r notation to traverse to the child relationship but no matter how i try it it doesn't work. In reading all of the documentation i can find on the subject it seems like i am doing it correctly. Of course it always does :) Here is my code what am i doing wrong?
<apex:page Standardcontroller="Opportunity" recordSetVar="Opp" standardStylesheets="True" showHeader="false" > <apex:Form > <apex:pageBlock title="Revenue List" mode="inlineEdit"> <apex:pageBlockButtons location="both"> <apex:commandButton action="{!quickSave}" value="Save"/> </apex:pageBlockButtons> <apex:pageBlockTable value="{!Opp}" var="op" width="100%"> <apex:Column width="100 (px)" > <apex:outputfield value="{!op.Name}"/> <apex:facet name="header">Opportunity</apex:facet> </apex:Column> </apex:pageBlockTable> </apex:pageBlock> <apex:pageBlock> <apex:pageBlockTable value="{!Opp.RevenueProjection__r}" var="re"> <apex:Column width="50(px)" > <apex:facet name="header">January</apex:facet> <apex:outputfield value="{!re.January__c}"/> </apex:Column> <apex:Column width="50px" > <apex:facet name="header">February</apex:facet> <apex:inputfield value="{!re.February__c}"/> </apex:Column> <apex:Column width="50px" > <apex:facet name="header">March</apex:facet> <apex:inputfield value="{!re.March__c}"/> </apex:Column> <apex:Column width="50px" > <apex:facet name="header">April</apex:facet> <apex:inputfield value="{!re.April__c}"/> </apex:Column> <apex:Column width="50px" > <apex:facet name="header">May</apex:facet> <apex:inputfield value="{!re.May__c}"/> </apex:Column> <apex:Column width="50px" > <apex:facet name="header">June</apex:facet> <apex:inputfield value="{!re.June__c}"/> </apex:Column> <apex:Column width="50px" > <apex:facet name="header">July</apex:facet> <apex:inputfield value="{!re.July__c}"/> </apex:Column> <apex:Column width="50px" > <apex:facet name="header">August</apex:facet> <apex:inputfield value="{!re.August__c}"/> </apex:Column> <apex:Column width="50px" > <apex:facet name="header">September</apex:facet> <apex:inputfield value="{!re.September__c}"/> </apex:Column> <apex:Column width="50px" > <apex:facet name="header">October</apex:facet> <apex:inputfield value="{!re.October__c}"/> </apex:Column> <apex:Column width="50px" > <apex:facet name="header">November</apex:facet> <apex:inputfield value="{!re.November__c}"/> </apex:Column> <apex:Column width="50px" > <apex:facet name="header">December</apex:facet> <apex:inputfield value="{!re.August__c}"/> </apex:Column> </apex:pageBlockTable> </apex:pageBlock> </apex:Form> </apex:page>
All Answers
I want it to display like this
Opportunity 1
jan feb march april may june etc....
Opportunity 2
jan feb march april may june etc....
My hope is that it will use the recordsetVar to traverse to the RevenueProjection and create the second pageblock table then much like a for loop keep going until all the opportunities are displayed. Obviously it will need some filtering but I want to get it working this far first. Thanks for taking a first crack at it. Hopefully this clarifies what I am trying to accomplish
sorry that format is kind of weird it looks much better in the page editor.