• M Colo
  • NEWBIE
  • 0 Points
  • Member since 2012

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 1
    Replies

I have 2 objects, contacts(parent) and custom_1(child).  Im pulling info from both objects and need to display it in a VF table.  So in the controller I have the following query

 

exportGuestList = Database.query(

'select Salutation, FirstName, LastName, Email, Phone, MobilePhone, Company_Name__c, Title, Business_Address__c, Alternate_Address__c, GroupName__c  '+

 

', (SELECT Addres__c FROM Custom_1__r)'+

 

' from Contact where Deceased__c = false AND Id IN(select Custom_2__c '+

 

' from Custom_3__c where Custom_2__c = \''+

whereSQLContactId +

'\') order by LastName ASC LIMIT 5000');

 

I have no problems rendering the contact fields in the table, but when I attempt to render the addres__c field, like so:

 

<apex:pageBlockrendered="{!NOT(ContactsCount==0)}"title="Contacts:">

<apex:pageBlockTablevalue="{!exportGuestList}"var="selecCont">

<apex:columnvalue="{!selecCont.Salutation}"/>

<apex:columnvalue="{!selecCont.LastName}"/>

<apex:columnvalue="{!selecCont.FirstName}"/>

<apex:columnvalue="{!selecCont.Email}"/>

<apex:columnvalue="{!selecCont.Phone}"/>

<apex:columnvalue="{!selecCont.MobilePhone}"/>

<apex:columnvalue="{!selecCont.Company_Name__c}"/>

<apex:columnvalue="{!selecCont.Title}"/>

<apex:columnvalue="{!selecCont.Business_Address__c}"/>

<apex:columnvalue="{!selecCont.Addres__c}"/>

 

I get the following Error:

Error: Invalid field Addres__c for SObject Contact

 

How can I specify in the VF page the proper reference to Custom_1

 

If I append Custom_1__r.  to Addres__c in the table I get:

 

Error: Unknown property 'VisualforceArrayList.Addres__c'
 
Somewhat new to SOQL and apex so i've been pretty stumped on this.
 
Thank you
  • November 08, 2012
  • Like
  • 0

I have 2 objects, contacts(parent) and custom_1(child).  Im pulling info from both objects and need to display it in a VF table.  So in the controller I have the following query

 

exportGuestList = Database.query(

'select Salutation, FirstName, LastName, Email, Phone, MobilePhone, Company_Name__c, Title, Business_Address__c, Alternate_Address__c, GroupName__c  '+

 

', (SELECT Addres__c FROM Custom_1__r)'+

 

' from Contact where Deceased__c = false AND Id IN(select Custom_2__c '+

 

' from Custom_3__c where Custom_2__c = \''+

whereSQLContactId +

'\') order by LastName ASC LIMIT 5000');

 

I have no problems rendering the contact fields in the table, but when I attempt to render the addres__c field, like so:

 

<apex:pageBlockrendered="{!NOT(ContactsCount==0)}"title="Contacts:">

<apex:pageBlockTablevalue="{!exportGuestList}"var="selecCont">

<apex:columnvalue="{!selecCont.Salutation}"/>

<apex:columnvalue="{!selecCont.LastName}"/>

<apex:columnvalue="{!selecCont.FirstName}"/>

<apex:columnvalue="{!selecCont.Email}"/>

<apex:columnvalue="{!selecCont.Phone}"/>

<apex:columnvalue="{!selecCont.MobilePhone}"/>

<apex:columnvalue="{!selecCont.Company_Name__c}"/>

<apex:columnvalue="{!selecCont.Title}"/>

<apex:columnvalue="{!selecCont.Business_Address__c}"/>

<apex:columnvalue="{!selecCont.Addres__c}"/>

 

I get the following Error:

Error: Invalid field Addres__c for SObject Contact

 

How can I specify in the VF page the proper reference to Custom_1

 

If I append Custom_1__r.  to Addres__c in the table I get:

 

Error: Unknown property 'VisualforceArrayList.Addres__c'
 
Somewhat new to SOQL and apex so i've been pretty stumped on this.
 
Thank you
  • November 08, 2012
  • Like
  • 0