Activity Forums Salesforce® Discussions Salesforce SOQL query for AccountContactRelation object

  • Salesforce SOQL query for AccountContactRelation object

    Posted by Martina on November 21, 2017 at 7:37 am

    There is a standard junction object called AccountContactRelation which is seen when option for multiple accounts to single contact is enabled.

    What query should be written to store the values in a Map?

    I need the Contact id, Account id in a map. Or else, Contact id and the SObject.

    Please help!

    Gouse Pasha Shaik replied 7 years ago 2 Members · 1 Reply
  • 1 Reply
  • Gouse Pasha Shaik

    Member
    November 23, 2017 at 6:53 am

    First allow "Allow users to relate a contact to multiple accounts" in setup --> account settings and then use below query to get the account and contact details.

    select accountid,ContactId from AccountContactRelation

    and use result as per your requirement.

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos