Hello
I'm trying to create a work order through an HTTP POST request. This is the request:
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.
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!
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.
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!
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 290,902 Super User 2024 Season 2
Martin Dráb 229,336 Most Valuable Professional
nmaenpaa 101,156