Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Microsoft Dynamics 365 | Integration, Dataverse...
Suggested answer

How to Add an Existing Record into a Subgrid in Dynamics 365 CRM Using c#

(0) ShareShare
ReportReport
Posted on by 62

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

  • Suggested answer
    Wahaj Rashid Profile Picture
    11,321 on at
    RE: How to Add an Existing Record into a Subgrid in Dynamics 365 CRM Using c#

    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:

    Web API CDSWebApiService Basic Operations Sample (C#) (Microsoft Dataverse) - Power Apps | Microsoft Docs

    You can also Postman to test your scenarios:

    Set up a Postman environment (Developer Guide for Dynamics 365 Customer Engagement) | Microsoft Docs

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 293,296 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 232,093 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156 Moderator

Leaderboard

Product updates

Dynamics 365 release plans