I'm new to CRM and for an entity I need to retrieve related entity info using the web api. I'm trying to do this based on the relationship metadata that can be retrieved using the api. For exmple I have the account entity. If I get the relationship data between entity and contact I get the following:
"value": [
{
"SchemaName": "contact_customer_accounts",
"ReferencingEntity": "contact",
"ReferencingAttribute": "parentcustomerid",
"ReferencedEntity": "account",
"ReferencedAttribute": "accountid",
"MetadataId": "dc9b80f8-c781-46d8-9fd6-a3b610836975"
},
{
"SchemaName": "account_primary_contact",
"ReferencingEntity": "account",
"ReferencingAttribute": "primarycontactid",
"ReferencedEntity": "contact",
"ReferencedAttribute": "contactid",
"MetadataId": "410707b1-9554-4cd9-8437-6608b1802904"
}
]
Based on this information I would like to retrieve the contacts for a account, so I would create a http request with someting like;
https://<my_crm_url>/api/data/v8.2/contact?$select=<some attributes>&filter=parentcustomerid eq '<account id value>'
When executing the request I get an error 'Resource not found for the segment 'contact'. When I change contact to contacts I get the error 'Could not find a property named 'parentcustomerid' on type 'Microsoft.Dynamics.CRM.contact''
What am I missing here? Can someone me please provide me some tips on how to achieve this.
Thanks in advance!
*This post is locked for comments
I have the same question (0)