• John Ross 9
  • NEWBIE
  • 10 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 2
    Replies
Hello.  I'm having a bit of trouble understanding why I'm getting an error in SOQL.  Here's the query: 

SELECT CustomerTeamMember__c, CustomerTeam__c, Contact__r.Email FROM Customer_Team__c WHERE CustomerTeam__c = '006i000000OOuPSAA1' AND UseInLoop__c = True

Without the Contact__r.Email, everything works.  I'm looping a custom object (related list) on Opportunities - this works fine.  The related list has a lookup to the standard object "Contact" and I want to pull the email field from there.  I don't want to run a query within a loop to avoid governor limits.   Can anyone help me figure out why this is not working?

The error is: Didn't understand relationship 'Contact__r' in field path. If you are attempting to use a custom relationship, be sure to append the '__r' after the custom relationship name. Please reference your WSDL or the describe call for the appropriate names.
Hello.  I'm having a bit of trouble understanding why I'm getting an error in SOQL.  Here's the query: 

SELECT CustomerTeamMember__c, CustomerTeam__c, Contact__r.Email FROM Customer_Team__c WHERE CustomerTeam__c = '006i000000OOuPSAA1' AND UseInLoop__c = True

Without the Contact__r.Email, everything works.  I'm looping a custom object (related list) on Opportunities - this works fine.  The related list has a lookup to the standard object "Contact" and I want to pull the email field from there.  I don't want to run a query within a loop to avoid governor limits.   Can anyone help me figure out why this is not working?

The error is: Didn't understand relationship 'Contact__r' in field path. If you are attempting to use a custom relationship, be sure to append the '__r' after the custom relationship name. Please reference your WSDL or the describe call for the appropriate names.