Toggle Side Panel

  • Blogs
  • Consultants
    • Salesforce Product Expertise
      • Top Salesforce ConsultantsTop Salesforce Consultants
      • Marketing Cloud ConsultantsMarketing Cloud Consultants
      • Service Cloud ConsultantsService Cloud Consultants
      • Experience Cloud ConsultantsExperience Cloud Consultants
      • Analytics Cloud ConsultantsAnalytics Cloud Consultants
    • Salesforce Industry Expertise
      • Non-Profit Cloud ConsultantsNon-Profit Cloud Consultants
      • Financial Service Cloud ConsultantsFinancial Service Cloud Consultants
      • Health Cloud ConsultantsHealth Cloud Consultants
      • Commerce Cloud ConsultantsCommerce Cloud Consultants
      • Manufacturing Cloud ConsultantsManufacturing Cloud Consultants
    • Salesforce Experts by Location
      • USATop Salesforce Consultants in USA
      • IndiaTop Salesforce Consultants in India
      • AustraliaTop Salesforce Consultants in Australia
      • United KingdomTop Salesforce Consultants in UK
      • CanadaTop Salesforce Consultants in Canada
  • Webinars
  • Contact Us
  • Discussions
More options
    Sign in Sign up
    • Blogs
    • Consultants
      • Salesforce Product Expertise
        • Top Salesforce ConsultantsTop Salesforce Consultants
        • Marketing Cloud ConsultantsMarketing Cloud Consultants
        • Service Cloud ConsultantsService Cloud Consultants
        • Experience Cloud ConsultantsExperience Cloud Consultants
        • Analytics Cloud ConsultantsAnalytics Cloud Consultants
      • Salesforce Industry Expertise
        • Non-Profit Cloud ConsultantsNon-Profit Cloud Consultants
        • Financial Service Cloud ConsultantsFinancial Service Cloud Consultants
        • Health Cloud ConsultantsHealth Cloud Consultants
        • Commerce Cloud ConsultantsCommerce Cloud Consultants
        • Manufacturing Cloud ConsultantsManufacturing Cloud Consultants
      • Salesforce Experts by Location
        • USATop Salesforce Consultants in USA
        • IndiaTop Salesforce Consultants in India
        • AustraliaTop Salesforce Consultants in Australia
        • United KingdomTop Salesforce Consultants in UK
        • CanadaTop Salesforce Consultants in Canada
    • Webinars
    • Contact Us
    • Discussions
    Close search

    Activity › Forums › Salesforce® Discussions › SOQL to fetch account details through a AccountContactRelation object in Salesforce

    Tagged: Account Detail, Contact Record, Custom Relationship, Salesforce Org, Salesforce SOQL

    • Salesforce® Discussions

      SOQL to fetch account details through a AccountContactRelation object in Salesforce

      Posted by Martina on November 20, 2017 at 7:51 PM

      Hi,

      I am stuck with a problem here.

      I have enabled multiple Accounts to Contact in my salesforce org. This creates a junction object called AccountContactRelation.

      I need to write a query which would fetch the account details like Account id, name, record type of the Accounts linked to a Contact.

      Condition is, only those account details should be fetched where the contact has more than one account linked to it.

      Can someone please help. It is urgent

      Thanks!

      Manpreet replied 8 years, 8 months ago 2 Members · 1 Reply
      • Account Detail
      • Contact Record
      • Custom Relationship
      • Salesforce Org
      • Salesforce SOQL
    • 1 Reply
    • Manpreet

      Member
      January 17, 2018 at 7:49 AM

      Hi Martina,

      You can use SOQL Query something Like this :

      [Select AccountId from Account group by ContactId having count(Name) > 1];

      Thanks.

    Log In to reply.

    • Public
    • All Members
    • My Connections
    • Only Me
    • Public
    • All Members
    • My Connections
    • Only Me
    • Public
    • All Members
    • My Connections
    • Only Me

    Popular Salesforce Blogs

    How to leverage NetSuite and Salesforce's Analytics Capabilities hand in hand?

    How to leverage NetSuite and Salesforce's Analytics Capabilities hand in hand?

    Blog in Analytics

    NetSuite and Salesforce are today's most popular cloud-based business management software solutions. While each platform has its strengths and unique features, many businesses use both…

    Business Performance, CRM, CRM Solutions, Custom Integration, Customer Relationship Management
    Charulatha Mar 27, 2023
    1,435  Views
    apex to lightning

    How to Convert sforce.apex.execute to Lightning | Salesforce Developer Guide

    Blog in Lightning, Salesforce Apex

    Introduction In this blog, we will learn how to directly call the apex class through a custom button or javascript button on the object detail…

    Creating Custom Buttons, Custom Button, Detail Page, JavaScript, JavaScript Button
    Kirandeep Feb 25, 2021
    11,828  Views

    Driving Innovation With Ideas From Your Online Community | Salesforce Guide

    Blog in Salesforce, Salesforce customization

    Innovation is the key to business growth. In order to come up with a successful product, you need to make the most of ideas and…

    Build Products, Business Growth, Business Needs, Classic, community
    Sukhwinder Singh Feb 2, 2022
    4,100  Views

    Popular Salesforce Videos

    Salesforce Data Management - Data Loader - Insert, Update, Upsert, Export, Delete

    Salesforce Data Management - Data Loader - Insert, Update, Upsert, Export, Delete

    Video in Data

    Use the Data Loader wizards to add, modify, or delete records. The upsert wizard combines inserting and updating a record. If a record in your…

    Salesforce Training, Salesforce Tutorial, Salesforce Data Management, Salesforce Video, Salesforce Learning
    Prafull Aug 24, 2021
    3,407  Views
    Salesforce CPQ from Scratch

    Salesforce CPQ from Scratch

    Video in Others

    CPQ Salesforce, or Configure, Price, Quote Software by Salesforce is a sales tool for companies to provide accurate pricing with any given product configuration scenario.…

    Salesforce Training, Salesforce Tutorial, Salesforce Training Videos, Salesforce Beginner Tutorial, Salesforce CPQ
    Vibhor Aug 31, 2018
    3,696  Views
    Case Escalation In Salesforce | Salesforce Development Tutorial

    Case Escalation In Salesforce | Salesforce Development Tutorial

    Video in Salesforce Training

    Case Escalation in Salesforce. This video will cover the following points - 1. Case escalation Get a brief introduction about case escalation. 2. Configuration Take…

    Salesforce Training, salesforce, Salesforce Development Tutorial, Salesforce Video, Salesforce Learning
    Algoworks Jun 22, 2021
    2,104  Views
    Footer Forcetalks logo

    support@forcetalks.com

    • twitterx

    Quick Links

    Advertise with Us

    Salesforce® Articles

    Dreamforce 2023

    Top Salesforce® Bloggers 2023

    Top Salesforce Consultants

    Get Listed

    Company

    Contact Us

    About Us

    Privacy Policy

    Terms & Conditions

    InsightHub

    Salesforce Blogs

    Salesforce Videos

    Salesforce Groups

    Salesforce Jobs

    © 2026 - Forcetalks ● All Rights Reserved

    Salesforce® is a trademark of Salesforce® Inc. No claim is made to the exclusive right to use “Salesforce”. Any services offered within the Forcetalks website/app are not sponsored or endorsed by Salesforce®.

    We use cookies to enhance your browsing experience. Please see our privacy policy if you'd like more information on our use of cookies.