Announcements
Hi All,
How to Add an Existing Record into a Subgrid in Dynamics 365 CRM Using c#.
Let us take a scenario on the Account record where we need to add an existing contact in the Contacts Subgrid.
thanks in advance .
Regards,
Prakash M
Hi,
Thank you for your query.
You can use Web API to bind the contact with an account.
Here is the Web API request example:
PATCH [Organization URI]/api/data/v9.0/contacts(<Contact-Guid>) HTTP/1.1
Content-Type: application/json
Accept: application/json
OData-MaxVersion: 4.0
OData-Version: 4.0
{
"parentcustomerid@odata.bind":"[Organization URI]/api/data/v9.0/accounts(<Account-Guid>)"
}
You can use HttpRequest or HTTPClient to post request on Dynamics 365 Web API.
Here is the official samples using C#. Net:
You can also Postman to test your scenarios:
Set up a Postman environment (Developer Guide for Dynamics 365 Customer Engagement) | Microsoft Docs
André Arnaud de Cal...
293,296
Super User 2025 Season 1
Martin Dráb
232,093
Most Valuable Professional
nmaenpaa
101,156
Moderator