You need to sign in to do that
Don't have an account?
Kevin Radmall
SOQL - Child Relationship showing up on Visual Force Page
Hi Everyone,
I am having an issue getting child recording showing up on a visual force page
Here is my current controller and visual forcepage code
public class MRAController { List<Account> Acts = [Select a.Name, (Select Id , Name, CreatedDate From Opportunities ORDER BY CreatedDate DESC LIMIT 1), (Select Title, CreatedDate From NotesAndAttachments ORDER BY CreatedDate DESC LIMIT 1), (Select Description, CreatedDate From ActivityHistories ORDER BY CreatedDate DESC LIMIT 1) From Account a WHERE OWNERID ='00570000003FI8tAAG' LIMIT 1]; List<Account> Acts2 = [Select a.Name, (Select Id, Name, CreatedDate From Opportunities ORDER BY CreatedDate DESC LIMIT 1), (Select Title, CreatedDate From NotesAndAttachments ORDER BY CreatedDate DESC LIMIT 1), (Select Description, CreatedDate From ActivityHistories ORDER BY CreatedDate DESC LIMIT 1) From Account a WHERE OWNERID ='00570000002ZCzzAAG']; public List<Account> getActs(){ return Acts; } public List<Account> getActs2(){ return Acts2; } }
<apex:page sidebar="false" controller="MRAController" >
<apex:form >
<apex:tabPanel activeTabClass="Blue" switchtype="ajax" >
<apex:tab label="Jim Bridger" LabelWidth="100" id="tb1"><apex:pageBlock >
<apex:pageBlockTable value="{!Acts}" var="a" ID="table">
<apex:Column value="{!a.ID}" Width="120"/>
<apex:Column value="{!a.Name}"/>
</apex:pageBlockTable>
</apex:pageBlock>
</apex:tab>
<apex:tab label="Jim Bridger 2" LabelWidth="100" id="tb2">
<apex:pageBlock >
<apex:PageBlockTable value="{!Acts2}" var="b">
<apex:column value="{!b.ID}"/>
<apex:column value="{!b.Name}"/>
</apex:PageBlockTable>
</apex:pageBlock>
</apex:tab>
</apex:tabPanel>
</apex:form>
</apex:page>
I am having an issue displaying the opportunites
Right now I can only get the Account Information to display and can not get the Opportunity Information to display
Account Name - Opportunity ID - Opportunity Name - Note Title - Created Date - Activity Title - Created Date
I am having an issue getting child recording showing up on a visual force page
Here is my current controller and visual forcepage code
public class MRAController { List<Account> Acts = [Select a.Name, (Select Id , Name, CreatedDate From Opportunities ORDER BY CreatedDate DESC LIMIT 1), (Select Title, CreatedDate From NotesAndAttachments ORDER BY CreatedDate DESC LIMIT 1), (Select Description, CreatedDate From ActivityHistories ORDER BY CreatedDate DESC LIMIT 1) From Account a WHERE OWNERID ='00570000003FI8tAAG' LIMIT 1]; List<Account> Acts2 = [Select a.Name, (Select Id, Name, CreatedDate From Opportunities ORDER BY CreatedDate DESC LIMIT 1), (Select Title, CreatedDate From NotesAndAttachments ORDER BY CreatedDate DESC LIMIT 1), (Select Description, CreatedDate From ActivityHistories ORDER BY CreatedDate DESC LIMIT 1) From Account a WHERE OWNERID ='00570000002ZCzzAAG']; public List<Account> getActs(){ return Acts; } public List<Account> getActs2(){ return Acts2; } }
<apex:page sidebar="false" controller="MRAController" >
<apex:form >
<apex:tabPanel activeTabClass="Blue" switchtype="ajax" >
<apex:tab label="Jim Bridger" LabelWidth="100" id="tb1"><apex:pageBlock >
<apex:pageBlockTable value="{!Acts}" var="a" ID="table">
<apex:Column value="{!a.ID}" Width="120"/>
<apex:Column value="{!a.Name}"/>
</apex:pageBlockTable>
</apex:pageBlock>
</apex:tab>
<apex:tab label="Jim Bridger 2" LabelWidth="100" id="tb2">
<apex:pageBlock >
<apex:PageBlockTable value="{!Acts2}" var="b">
<apex:column value="{!b.ID}"/>
<apex:column value="{!b.Name}"/>
</apex:PageBlockTable>
</apex:pageBlock>
</apex:tab>
</apex:tabPanel>
</apex:form>
</apex:page>
I am having an issue displaying the opportunites
Right now I can only get the Account Information to display and can not get the Opportunity Information to display
Account Name - Opportunity ID - Opportunity Name - Note Title - Created Date - Activity Title - Created Date
All Answers
So I have 7 users that I want each on seperate tabs all need to display the same information within their tabs.
I would like the child records to simply be right next to the master record if it exsist, if not just to display blank.