web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Unanswered

Javascript/Api Call to Create a new record with a lookup field

(0) ShareShare
ReportReport
Posted on by 99

Hi All,

I am trying to create a record using code below generated from XRM CRM Rest Builder. The code works if I remove the lookup field so I know its a problem there. Any ideas what I am missing?

xxxxx is my tenant code which I am just masking.

var entity = {};
entity.cr93b_name = results.entities[i]["xxxxx_jdeadressbooknumber"];
entity.cr93b_contacttype = 900450000;
entity.cr93b_emailaddress = results.entities[i]["xxxxx_emailaddress"];
entity.cr93b_phonenumber = results.entities[i]["xxxxx_phonenumber"];
entity.cr93b_jdeaddressbooknumber = results.entities[i]["xxxxx_jdeadressbooknumber"];
entity["cr93b_vendorrequestmanagementid@odata.bind"] = "/xxxxx_vendorrequestmanagements(9d7fb079-5082-44d8-a60c-292be6f4f68d)";

Xrm.WebApi.online.createRecord("xxxxx_vendorrequestmanagementcontactinfo", entity);

If I comment out the lookup field it creates the record.

I have the same question (0)
  • Martin Dráb Profile Picture
    239,636 Most Valuable Professional on at

    Is this somehow related to Dynamics 365 Finance or shall I move it to another forum?

  • mykedeabreu Profile Picture
    99 on at

    Hi Martin - its not apologies. didnt realize I was inside the finance forum

  • Martin Dráb Profile Picture
    239,636 Most Valuable Professional on at

    No problem, I can simply move the thread. Do you know which forum would be appropriate?

  • mykedeabreu Profile Picture
    99 on at

    General I think is good.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
ManoVerse Profile Picture

ManoVerse 73 Super User 2026 Season 1

#2
Muhammad Shahzad Shafique Profile Picture

Muhammad Shahzad Sh... 69 Most Valuable Professional

#3
11manish Profile Picture

11manish 50

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans