Skip to main content

Notifications

Customer experience | Sales, Customer Insights,...
Suggested answer

Cant POST a new entity via "api/data/v8.1/" in JS with lookUp field.

Posted on by 60

so try this :

pastedimage1647595638847v1.png

my post script is :

pastedimage1647595669880v2.png

keep telling me the same error:

pastedimage1647595698725v3.png

i try to use the related entity schema name, i try the main entity lookup field schema name and nothing !!

can some one help me pls

  • Suggested answer
    Bipin D365 Profile Picture
    Bipin D365 28,964 Super User 2024 Season 1 on at
    RE: Cant POST a new entity via "api/data/v8.1/" in JS with lookUp field.

    Hi,

    You have mentioned incorrect related entity logical name. You are missing prefix in your related entity name in your code.

    so your syntax should be like below -

    "new_SkillId@odata.bind"="/new_skills(recordGUID)";

    if your related entity is custom table then it should be new_skills in case your are using new_ as prefix. If your related table is any OOB table then please check your entity logical name.

    Skills and Roles can not be the related entity name.

    Please mark my answer verified if this is helpful!

    Regards,

    Bipin Kumar

    Follow my Blog: xrmdynamicscrm.wordpress.com/

  • Suggested answer
    Guido Preite Profile Picture
    Guido Preite 54,081 Super User 2024 Season 1 on at
    RE: Cant POST a new entity via "api/data/v8.1/" in JS with lookUp field.

    then you can use my tool Dataverse REST Builder (you can install the managed solution or use the XrmToolBox version) to create the javascript code (the endpoint in your case can be 9.0, 9.1 or 9.2, 8.1 is for CRM 2016 and is not supported inside my tool)

    my tool can give you the exact syntax for all the fields you need to add to your action, especially lookups

    you can also use the jQuery or the Fetch API syntax, because XMLHttpRequest is quite old (but my tool can generate also it)

    after you can modify the generated code to adapt to your variables (url and IDs)

    you can find the Dataverse REST Builder link in my signature

  • PerryDev Profile Picture
    PerryDev 60 on at
    RE: Cant POST a new entity via "api/data/v8.1/" in JS with lookUp field.

    I'm using dynamics on browser, the version is 1710 (9.2.22023.140) online.

  • Guido Preite Profile Picture
    Guido Preite 54,081 Super User 2024 Season 1 on at
    RE: Cant POST a new entity via "api/data/v8.1/" in JS with lookUp field.

    which exact version is this Dynamics CRM / 365 instance?

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,240 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,149 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans