Skip to main content

Notifications

Service | Customer Service, Contact Center, Fie...
Answered

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

Posted on by Microsoft Employee

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!

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Complete!

🔔 Be sure to subscribe to the new forums you are interested in to stay up to date! 🔔

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,902 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 229,336 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans