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

Notifications

Announcements

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 721 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 320 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard