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

Notifications

Announcements

No record found.

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
    237,884 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
    237,884 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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 96 Super User 2025 Season 2

#2
Jimmy Passeti Profile Picture

Jimmy Passeti 50 Most Valuable Professional

#3
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 49 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans