You need to sign in to do that
Don't have an account?

How do I Display Fields from the AccountContactRelation Object on a Visualforce page Using a subquery
I have the following Soql call in my controller:
public with sharing class getAccountContactRelations {
public static list<account> getAccounts() {
LIST <Account> MemberInfo = [SELECT Id, Name, (SELECT Id,Contact.Name,Contact.Cardholder_Type__c,Contact.AccountId,
Contact.email,Contact.MailingAddress,Contact.City_Secondary__c,Contact.Zip_Code_Secondary__c,Contact.State_Secondary__c,
Contact.MobilePhone,Account.name
FROM AccountContactRelations where Contact.Cardholder_Type__c = 'Authorized' Or Contact.Cardholder_Type__c = 'Primary' )
FROM Account WHERE Id = '001M000000xMs8V'];
return MemberInfo;
}
}
My Visualforce page has the following code:
<apex:page controller="getAccountContactRelations">
<apex:pageblock>
<apex:pageblockTable value="{!Accounts}" var="a">
<apex:pageblockTable value="{!a.AccountContactRelations}" var="r">
<apex:column headerValue="City" value="{!r.Contact.City_Secondary__c}"/>
</apex:pageblockTable>
</apex:pageblockTable>
</apex:pageblock>
</apex:page>
The Object has values but they are not being displayed on the Visualforce page.
How should my visualforce page be coded so I can see the results of my subquery?
Thank you
public with sharing class getAccountContactRelations {
public static list<account> getAccounts() {
LIST <Account> MemberInfo = [SELECT Id, Name, (SELECT Id,Contact.Name,Contact.Cardholder_Type__c,Contact.AccountId,
Contact.email,Contact.MailingAddress,Contact.City_Secondary__c,Contact.Zip_Code_Secondary__c,Contact.State_Secondary__c,
Contact.MobilePhone,Account.name
FROM AccountContactRelations where Contact.Cardholder_Type__c = 'Authorized' Or Contact.Cardholder_Type__c = 'Primary' )
FROM Account WHERE Id = '001M000000xMs8V'];
return MemberInfo;
}
}
My Visualforce page has the following code:
<apex:page controller="getAccountContactRelations">
<apex:pageblock>
<apex:pageblockTable value="{!Accounts}" var="a">
<apex:pageblockTable value="{!a.AccountContactRelations}" var="r">
<apex:column headerValue="City" value="{!r.Contact.City_Secondary__c}"/>
</apex:pageblockTable>
</apex:pageblockTable>
</apex:pageblock>
</apex:page>
The Object has values but they are not being displayed on the Visualforce page.
How should my visualforce page be coded so I can see the results of my subquery?
Thank you
Did you check values are coming into MemberInfo list or not.
Thank you