• JJ1234
  • NEWBIE
  • 0 Points
  • Member since 2021

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

I'm relatively new to SOQL and Conga Query builder and am attempting to query related data of the same object, using a lookup of the current object. Here is how the objects are related:

From the current Custom object, I have a lookup relationship to accounts--the field is Primary Account. I'd like to query all other related objects of the same type as the current object. My statement looks like this so far, however, it is failing.

SELECT Custom_Field1__c, Name FROM Custom__c WHERE Primary_Account__r.Id = Primary_Account__c.Id

Primary_Account__r.Id is the ID of the Master "Primary Account" on the Custom record, but the query doesn't seem to be pulling the Id to match from the current custom object so that the query can pull all related Custom_Field1 and Name fields from the other custom objects related to the Primary Account. I hope this all makes sense.

Thank you in advance.
  • January 15, 2021
  • Like
  • 1
Hello,

I'm relatively new to SOQL and Conga Query builder and am attempting to query related data of the same object, using a lookup of the current object. Here is how the objects are related:

From the current Custom object, I have a lookup relationship to accounts--the field is Primary Account. I'd like to query all other related objects of the same type as the current object. My statement looks like this so far, however, it is failing.

SELECT Custom_Field1__c, Name FROM Custom__c WHERE Primary_Account__r.Id = Primary_Account__c.Id

Primary_Account__r.Id is the ID of the Master "Primary Account" on the Custom record, but the query doesn't seem to be pulling the Id to match from the current custom object so that the query can pull all related Custom_Field1 and Name fields from the other custom objects related to the Primary Account. I hope this all makes sense.

Thank you in advance.
  • January 15, 2021
  • Like
  • 1
Hello,

I'm relatively new to SOQL and Conga Query builder and am attempting to query related data of the same object, using a lookup of the current object. Here is how the objects are related:

From the current Custom object, I have a lookup relationship to accounts--the field is Primary Account. I'd like to query all other related objects of the same type as the current object. My statement looks like this so far, however, it is failing.

SELECT Custom_Field1__c, Name FROM Custom__c WHERE Primary_Account__r.Id = Primary_Account__c.Id

Primary_Account__r.Id is the ID of the Master "Primary Account" on the Custom record, but the query doesn't seem to be pulling the Id to match from the current custom object so that the query can pull all related Custom_Field1 and Name fields from the other custom objects related to the Primary Account. I hope this all makes sense.

Thank you in advance.
  • January 15, 2021
  • Like
  • 1