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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / How to Create Booking ...
Power Apps
Answered

How to Create Booking with Xrm.WebApi.create Record

(0) ShareShare
ReportReport
Posted on by 83

How do i create a booking with the Xrm.WebApi.createRecord. I have the following:

 

 

 

// Create Booking
var newBookData = {
 "name": newworkorder_result.name,
 "starttime": booking_result.starttime,
 "msdyn_estimatedarrivaltime": booking_result.msdyn_estimatedarrivaltime,
 "endtime": booking_result.endtime,
 "resource@odata.bind": `/bookableresources(${booking_result._resource_value})`
}
console.log(newBookData);

Xrm.WebApi.createRecord("bookableresourcebooking", newBookData).then(
 function success(result) {
 console.log(result);
 },
 function (error) {
 console.log(error.message);
 }
)

 

 


I keep getting:

 

 

1: Error identified in Payload provided by the user for Entity :'bookableresourcebookings', For more information on this error please follow this help link https://go.microsoft.com/fwlink/?linkid=2195293 ----> InnerException : Microsoft.OData.ODataException: An undeclared property 'resource_bookableresource' which only has property annotations in the payload but no property value was found in the payload. In OData, only declared navigation properties and declared named streams can be represented as properties without values.

 

 

 

This is usually related to like customer lookup fields, so not sure why I'm getting it on a normal lookup field. Any help would be appreciated. 

Categories:
I have the same question (0)
  • Verified answer
    v-xiaochen-msft Profile Picture
    Microsoft Employee on at

    Hi @jdaniel_dyn365 ,

     

    Please try to use 'Resource@odata.bind' instead of using 'resource@odata.bind'.

    vxiaochenmsft_0-1714446489248.png

    vxiaochenmsft_1-1714446523862.png

     

     

    Best Regards,

    Wearsky

  • jdaniel1 Profile Picture
    83 on at

    Thank You!!! You are correct XD after bashing my head for 3 hours, I realized the Microsoft documentation is not accurate to its explanation, there more to the original API docs there not explaining. I've been getting this error on most lookup fields assuming schema was the way to do it. But the exact field format is based on the ReferencingEntityNavigationPropertyName which is case sensitive. It's not necessarily based on just field schema as the Microsoft document sort of implies it is.  You can fine this in the Meta browser tools out there. 

     

    For out of the box fields, https://learn.microsoft.com/en-us/previous-versions/dynamicscrm-2016/developers-guide/mt718064(v=crm.8) this link is where I originally found the captial R Resource. 

     

    PS: I need to figure out how to authorize Postman again, lol I use that program alot, just never got around to figuring out Microsoft API on it. 

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 Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 519 Most Valuable Professional

#2
11manish Profile Picture

11manish 489

#3
Haque Profile Picture

Haque 327

Last 30 days Overall leaderboard