Search code examples
phpdynamics-crm

Dynamics CRM identify primary contacts in contact entity


Trying to fetch all the primary contacts from CRM.

URL is: /contacts

Question is any field in contact entity to identify the contact is primary.

Example: parentcustomerid = account id


Solution

  • Probably you are looking for this below one, which returns the primary contact from all accounts:

    https://crmdev.crm.dynamics.com/api/data/v9.1/accounts?$select=_primarycontactid_value
    

    Only to get Accounts with primary Contact contains data:

    https://crmdev.crm.dynamics.com/api/data/v9.1/accounts?$select=_primarycontactid_value&$filter=_primarycontactid_value ne null