Skip to main content

Notifications

Microsoft Dynamics CRM (Archived)

Set Company Name while creating contact using MS CRM web api + C#

Posted on by 35

I am getting "Bad Request" response while creating contact with company name.

Code I am using  to set account company is below.

_webApiURL = [Organization URI]/api/data/v8.2/

contact.Add("parentcustomerid@odata.bind", string.Format("{0}accounts(b6bc8b98-14e7-e611-8103-5065f38ac921)", _webApiURL));

*This post is locked for comments

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Set Company Name while creating contact using MS CRM web api + C#

    OMG, thanks. This one had me stumped for over an hour...

  • Amit Vaidya Profile Picture
    Amit Vaidya 35 on at
    RE: Set Company Name while creating contact using MS CRM web api + C#

    Thanks Jason

  • Verified answer
    jlattimer Profile Picture
    jlattimer 24,558 on at
    RE: Set Company Name while creating contact using MS CRM web api + C#

    Because parentcustomerid can be either account or contact you'll need to specify in the odata.bind

    parentcustomerid_account@odata.bind

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,253 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans