Activity Forums Salesforce® Discussions How to get related list of child account to parent account that has self-relationship in Salesforce?

  • How to get related list of child account to parent account that has self-relationship in Salesforce?

    Posted by Ayush on January 23, 2020 at 11:47 am

    How to get related list of child account to parent account that has self-relationship in Salesforce ?

    Anjali replied 4 years, 11 months ago 2 Members · 1 Reply
  • 1 Reply
  • Anjali

    Member
    January 23, 2020 at 12:59 pm

    You can get the related records by adding the child relationship name of the account that has look-up relationship and include that in the query.Your query could be like this-

    Select Id, (Select Id FROM Accounts__r) FROM Account

    Hope this helps!

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos