• pmarszalek
  • NEWBIE
  • 25 Points
  • Member since 2012

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

I am trying to collect all the data related to a custom object in a  single soql query (I am making the query call from the other side of a remote connection to my org, and only want to make one data transfer)

 

I have two custom objects  (comments__c and attachments) with master/detail look relationships to the source object(problem__c), and the query works fine

 

select id,priority__c,severity__c,summary__c,description__c,status__c,howtoreproduce__c,circumvention__c,impact__c,defectsystemnumber__c,(select name from attachments),(select name, body__c, created__c from comments__r) from problem__c where id='hhgkjhlkhhk'

 

I also have a junction object (map__c) which connects case to my problem__c object.

map__c : {name, id, {case__c: lookup case}, {prob__c:lookup problem__c}}

 

so I want to get fields out of the case record, linked thru the junction off this problem.

 

as a test , I 'should' be able to pull back the name field from the junction object using the normal syntax

 

select id, name, (select name from map__r) from problem__c where id='llllllll'

 

but I get a relationship error.."didn't understand the relationship map__r"

but this is the same syntax I used above for the other related objects..

 

once solved, I actually want to look thru the case lookup on the map to get case fields

 

select id, name (select case.number from case__r.map__r) from problem__c where id='kjkkjjlk'

 

(there could be more than one case related to this problem,so I need to get info from all of them)

(<- means pointing back to)

problem   list of comments (<- problem)

                  list of attachments (<- problem)

                  list of cases (<-problem thru junction object 'map')

                      (a case might be related to multiple problems, thus the need for the many to many junction)

 

thanks for any guidance.

 

  • March 01, 2012
  • Like
  • 0

I am trying to collect all the data related to a custom object in a  single soql query (I am making the query call from the other side of a remote connection to my org, and only want to make one data transfer)

 

I have two custom objects  (comments__c and attachments) with master/detail look relationships to the source object(problem__c), and the query works fine

 

select id,priority__c,severity__c,summary__c,description__c,status__c,howtoreproduce__c,circumvention__c,impact__c,defectsystemnumber__c,(select name from attachments),(select name, body__c, created__c from comments__r) from problem__c where id='hhgkjhlkhhk'

 

I also have a junction object (map__c) which connects case to my problem__c object.

map__c : {name, id, {case__c: lookup case}, {prob__c:lookup problem__c}}

 

so I want to get fields out of the case record, linked thru the junction off this problem.

 

as a test , I 'should' be able to pull back the name field from the junction object using the normal syntax

 

select id, name, (select name from map__r) from problem__c where id='llllllll'

 

but I get a relationship error.."didn't understand the relationship map__r"

but this is the same syntax I used above for the other related objects..

 

once solved, I actually want to look thru the case lookup on the map to get case fields

 

select id, name (select case.number from case__r.map__r) from problem__c where id='kjkkjjlk'

 

(there could be more than one case related to this problem,so I need to get info from all of them)

(<- means pointing back to)

problem   list of comments (<- problem)

                  list of attachments (<- problem)

                  list of cases (<-problem thru junction object 'map')

                      (a case might be related to multiple problems, thus the need for the many to many junction)

 

thanks for any guidance.

 

  • March 01, 2012
  • Like
  • 0

Hello,

 

I have created 3 custom objects in SF.  Each custom object contains a list of fields.  Some fields of the same name appear in all 3 custom objects.   I would like to know how to link fields with the same name in all 3 custom objects.

 

Thanks, sheila