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










0















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 run
SELECT 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.










share|improve this question


























    0















    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 run
    SELECT 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.










    share|improve this question
























      0












      0








      0








      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 run
      SELECT 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.










      share|improve this question














      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 run
      SELECT 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






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Mar 21 at 17:55









      Patrick 2NPatrick 2N

      464




      464






















          1 Answer
          1






          active

          oldest

          votes


















          0














          After trying dozens of combinations, what seems to work is SELECT BorrowerBusiness__r.Name FROM Projet__c. I have no idea why but hey...






          share|improve this answer























            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
            );



            );













            draft saved

            draft discarded


















            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









            0














            After trying dozens of combinations, what seems to work is SELECT BorrowerBusiness__r.Name FROM Projet__c. I have no idea why but hey...






            share|improve this answer



























              0














              After trying dozens of combinations, what seems to work is SELECT BorrowerBusiness__r.Name FROM Projet__c. I have no idea why but hey...






              share|improve this answer

























                0












                0








                0







                After trying dozens of combinations, what seems to work is SELECT BorrowerBusiness__r.Name FROM Projet__c. I have no idea why but hey...






                share|improve this answer













                After trying dozens of combinations, what seems to work is SELECT BorrowerBusiness__r.Name FROM Projet__c. I have no idea why but hey...







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Mar 26 at 15:59









                Patrick 2NPatrick 2N

                464




                464





























                    draft saved

                    draft discarded
















































                    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.




                    draft saved


                    draft discarded














                    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





















































                    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







                    Popular posts from this blog

                    SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

                    용인 삼성생명 블루밍스 목차 통계 역대 감독 선수단 응원단 경기장 같이 보기 외부 링크 둘러보기 메뉴samsungblueminx.comeh선수 명단용인 삼성생명 블루밍스용인 삼성생명 블루밍스ehsamsungblueminx.comeheheheh

                    155 수학 과학 기타 둘러보기 메뉴eh추가해eh문서를 완성해