SOQL join query based on a custom child traversing up to a standard parent The Next CEO of Stack OverflowJoin vs. sub-querySalesforce SOQL Queries and TagsSalesforce SOQL relationship query questionSalesforce SOQL Query to access a child field in WHERE statementHow to do 3 table JOIN in UPDATE query?Not able to return a field from a child of a parent in SOQLForce.com Toolkit for .NET class construct with QueryAsync when SQL query has a child/parent relationshipDidn't understand relationship 'opportunity__c' in field path.SOQL statement joining 2 objectsSalesforce Cross Object SOQL Query
Why doesn't UK go for the same deal Japan has with EU to resolve Brexit?
Why do airplanes bank sharply to the right after air-to-air refueling?
I believe this to be a fraud - hired, then asked to cash check and send cash as Bitcoin
Why is the US ranked as #45 in Press Freedom ratings, despite its extremely permissive free speech laws?
Inappropriate reference requests from Journal reviewers
Need help understanding a power circuit (caps and diodes)
Won the lottery - how do I keep the money?
Is it possible to replace duplicates of a character with one character using tr
is it ok to reduce charging current for li ion 18650 battery?
Domestic-to-international connection at Orlando (MCO)
The exact meaning of 'Mom made me a sandwich'
Chain wire methods together in Lightning Web Components
Why is quantifier elimination desirable for a given theory?
Is there a difference between "Fahrstuhl" and "Aufzug"
If Nick Fury and Coulson already knew about aliens (Kree and Skrull) why did they wait until Thor's appearance to start making weapons?
Is it professional to write unrelated content in an almost-empty email?
Do I need to write [sic] when a number is less than 10 but isn't written out?
Would a completely good Muggle be able to use a wand?
Beveled cylinder cutout
How a 64-bit process virtual address space is divided in Linux?
Why does the flight controls check come before arming the autobrake on the A320?
Writing differences on a blackboard
Make solar eclipses exceedingly rare, but still have new moons
Rotate a column
SOQL join query based on a custom child traversing up to a standard parent
The Next CEO of Stack OverflowJoin vs. sub-querySalesforce SOQL Queries and TagsSalesforce SOQL relationship query questionSalesforce SOQL Query to access a child field in WHERE statementHow to do 3 table JOIN in UPDATE query?Not able to return a field from a child of a parent in SOQLForce.com Toolkit for .NET class construct with QueryAsync when SQL query has a child/parent relationshipDidn't understand relationship 'opportunity__c' in field path.SOQL statement joining 2 objectsSalesforce Cross Object SOQL Query
I have a custom object Projet__c, child of Account, that I need to make a query on e.g. SELECT Id FROM Projet__c LIMIT 10. This works.
I want to retrieve the Account Name.
If the child was not custom, for example Contact, I could simply runSELECT Id, Account.Name FROM Contact (this works).
However SELECT Id, Account.Name FROM Projet__c fails with the following error message :
INVALID_FIELD:
SELECT Name, Account.Name
^
ERROR at Row:1:Column:14
Didn't understand relationship 'Account' 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.
Looking in Workbench, I can see that in Account, there is a child relationship projets__r with a custom field called BorrowerBusiness__c which is equal to Account.Id. Running the query on FROM projets__r or similar variants fail.
I could run the query the other way, SELECT Name, (SELECT Id from projets__r) FROM Account, which works but also returns all accounts without a project and is extremely slow as a result. This also precludes doing two queries and merging in e.g. Pandas.
join parent-child soql
add a comment |
I have a custom object Projet__c, child of Account, that I need to make a query on e.g. SELECT Id FROM Projet__c LIMIT 10. This works.
I want to retrieve the Account Name.
If the child was not custom, for example Contact, I could simply runSELECT Id, Account.Name FROM Contact (this works).
However SELECT Id, Account.Name FROM Projet__c fails with the following error message :
INVALID_FIELD:
SELECT Name, Account.Name
^
ERROR at Row:1:Column:14
Didn't understand relationship 'Account' 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.
Looking in Workbench, I can see that in Account, there is a child relationship projets__r with a custom field called BorrowerBusiness__c which is equal to Account.Id. Running the query on FROM projets__r or similar variants fail.
I could run the query the other way, SELECT Name, (SELECT Id from projets__r) FROM Account, which works but also returns all accounts without a project and is extremely slow as a result. This also precludes doing two queries and merging in e.g. Pandas.
join parent-child soql
add a comment |
I have a custom object Projet__c, child of Account, that I need to make a query on e.g. SELECT Id FROM Projet__c LIMIT 10. This works.
I want to retrieve the Account Name.
If the child was not custom, for example Contact, I could simply runSELECT Id, Account.Name FROM Contact (this works).
However SELECT Id, Account.Name FROM Projet__c fails with the following error message :
INVALID_FIELD:
SELECT Name, Account.Name
^
ERROR at Row:1:Column:14
Didn't understand relationship 'Account' 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.
Looking in Workbench, I can see that in Account, there is a child relationship projets__r with a custom field called BorrowerBusiness__c which is equal to Account.Id. Running the query on FROM projets__r or similar variants fail.
I could run the query the other way, SELECT Name, (SELECT Id from projets__r) FROM Account, which works but also returns all accounts without a project and is extremely slow as a result. This also precludes doing two queries and merging in e.g. Pandas.
join parent-child soql
I have a custom object Projet__c, child of Account, that I need to make a query on e.g. SELECT Id FROM Projet__c LIMIT 10. This works.
I want to retrieve the Account Name.
If the child was not custom, for example Contact, I could simply runSELECT Id, Account.Name FROM Contact (this works).
However SELECT Id, Account.Name FROM Projet__c fails with the following error message :
INVALID_FIELD:
SELECT Name, Account.Name
^
ERROR at Row:1:Column:14
Didn't understand relationship 'Account' 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.
Looking in Workbench, I can see that in Account, there is a child relationship projets__r with a custom field called BorrowerBusiness__c which is equal to Account.Id. Running the query on FROM projets__r or similar variants fail.
I could run the query the other way, SELECT Name, (SELECT Id from projets__r) FROM Account, which works but also returns all accounts without a project and is extremely slow as a result. This also precludes doing two queries and merging in e.g. Pandas.
join parent-child soql
join parent-child soql
asked Mar 21 at 17:55
Patrick 2NPatrick 2N
464
464
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
After trying dozens of combinations, what seems to work is SELECT BorrowerBusiness__r.Name FROM Projet__c. I have no idea why but hey...
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55286519%2fsoql-join-query-based-on-a-custom-child-traversing-up-to-a-standard-parent%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
After trying dozens of combinations, what seems to work is SELECT BorrowerBusiness__r.Name FROM Projet__c. I have no idea why but hey...
add a comment |
After trying dozens of combinations, what seems to work is SELECT BorrowerBusiness__r.Name FROM Projet__c. I have no idea why but hey...
add a comment |
After trying dozens of combinations, what seems to work is SELECT BorrowerBusiness__r.Name FROM Projet__c. I have no idea why but hey...
After trying dozens of combinations, what seems to work is SELECT BorrowerBusiness__r.Name FROM Projet__c. I have no idea why but hey...
answered Mar 26 at 15:59
Patrick 2NPatrick 2N
464
464
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55286519%2fsoql-join-query-based-on-a-custom-child-traversing-up-to-a-standard-parent%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown