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

I have the same question (0)
  • Verified answer
    Stefan Cojocaru Profile Picture
    on at

    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!

  • Community Member Profile Picture
    on at

    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.

  • Stefan Cojocaru Profile Picture
    on at

    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!

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 > Service | Customer Service, Contact Center, Field Service, Guides

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 45 Super User 2025 Season 2

#2
Daniyal Khaleel Profile Picture

Daniyal Khaleel 27 Most Valuable Professional

#3
Soundari Profile Picture

Soundari 15

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans