Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Service | Customer Service, Contact Center, Fie...
Answered

Error 0x80040265 when trying to create work order using POST request

(0) ShareShare
ReportReport
Posted on by

Hello

I'm trying to create a work order through an HTTP POST request. This is the request:

tempsnip.png

This is the error I recieve:

{"error":{"code":"0x80040265","message":"Object reference not set to an instance of an object."}}

The request used to work before. However, I changed the name of the account (not the GUID), which is used for the service and billing account for the work order.

Before you ask the obvious question: Yes, I have checked the urls and they all point to valid records in the system.

Some of the customer assets are inactive, however that does not seem to affect it.

I am utterly in the dark here. Any help is appreciated.

  • RE: Error 0x80040265 when trying to create work order using POST request

    Hi Frederik,

    Sometimes the names of properties are concatenated with other properties.

    Try to check the ReferentialConstraint Property inside the Navigation Property. This field should point to the actual lookup field.

    Thank you!

  • RE: Error 0x80040265 when trying to create work order using POST request

    I discovered that one of the navigation properties in my request could not be found in the metadata browser. I removed it from my request, and now it works. Thanks.

    However, why is it missing? If I open any work order in the environment, I can still see the lookup field, but the navigation property cannot be found in the metadata browser.

  • Verified answer
    RE: Error 0x80040265 when trying to create work order using POST request

    Hi Frederik,

    Can you try binding the records without using the full instance URL? Meaning, can you bind to just /accounts(GUID)  and  /msdyn_customerassets? Try to see if that makes a difference.

    Other than that, try to check the Odata Metadata to understand if the properties for which you are using binding have the correct names. To do this, go to Settings > Customizations > Developer resources and click on Download OData metadata.

    Inside that file, search for EntityType Name="<schema name of your entity>" and check the Navigation Properties you need.

    Hope this helps!

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,575 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,493 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans