Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Getting Bad request while updating custom lookup field via Web API(C#).

Posted on by

When I tried to update a assigned to attribute in Dynamics 365 via web API. I am getting Bad request. Tried with many options but not working.

Can any one help me on this.

Eg: assignWires["usb_assignedtoid@odata.bind"] = "/systemuser(3A531FEC-18D8-E611-8102-005056913E77)";

*This post is locked for comments

  • naZir Profile Picture
    naZir 850 on at
    RE: Getting Bad request while updating custom lookup field via Web API(C#).

    As goutam has suggested check the schema name: assignWires["usb_assignedtoid@odata.bind"] .

    Code generated by Rest Builder some time does not give correct schema name. 

    I have faced the same issue. After investigating i have found the schema name was wrong.

  • Suggested answer
    gdas Profile Picture
    gdas 50,085 on at
    RE: Getting Bad request while updating custom lookup field via Web API(C#).

    Hi ,

    I think the field name you are passing is not correct , provide exact field name of the lookup. 

    assignWires["usb_assignedtoid@odata.bind"] = "/systemusers(3A531FEC-18D8-E611-8102-005056913E77)";

    What is  your field name  usb_assignedtoid or usb_assignedto ? If your field name is usb_assignedto then dont add id part.

    In addition please share your complete code so that we can help you if above does not helps you.

  • RaviKashyap Profile Picture
    RaviKashyap 55,410 on at
    RE: Getting Bad request while updating custom lookup field via Web API(C#).

    can you share your full code? It is possible that the error is coming from some other statement.

  • RE: Getting Bad request while updating custom lookup field via Web API(C#).

    No. Not working.

  • RaviKashyap Profile Picture
    RaviKashyap 55,410 on at
    RE: Getting Bad request while updating custom lookup field via Web API(C#).

    So "systemusers" is also not working?

  • RE: Getting Bad request while updating custom lookup field via Web API(C#).

    No Ravi,

    I've tested with systemuser, assignedto, AssignedTo, Assignedto, assignedtoid, etc.. But not working.

  • RaviKashyap Profile Picture
    RaviKashyap 55,410 on at
    RE: Getting Bad request while updating custom lookup field via Web API(C#).

    Hi,

    Did you try "/systemusers" instead of "/systemuser"?

    Hope this helps.

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!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans