OData update

larshs
Member Posts: 17
Hi,
I'm having problems updating records using OData web services on Business Central. I've published a couple of pages, 21 and 518, as OData web services. The both return json perfectly, and I can set filters also. However, when updating, I get an HTTP 405 - Method Not Allowed. The the event viewer on the NAV server the following error is logged:
Message (NavODataMethodNotAllowedException): RootException: NavODataMethodNotAllowedException
Entity does not support insert.
The user I use to access the web service is super, so I don't think the issue is related to permissions. Could I be missing some settings in the setup?
BR.
Lars
I'm having problems updating records using OData web services on Business Central. I've published a couple of pages, 21 and 518, as OData web services. The both return json perfectly, and I can set filters also. However, when updating, I get an HTTP 405 - Method Not Allowed. The the event viewer on the NAV server the following error is logged:
Message (NavODataMethodNotAllowedException): RootException: NavODataMethodNotAllowedException
Entity does not support insert.
The user I use to access the web service is super, so I don't think the issue is related to permissions. Could I be missing some settings in the setup?
BR.
Lars
0
Best Answer
-
Hi vremeni4
I know this a a bit of an old post, but what you state is incorrect.
Business Central supports edit/delete/insert via OData or ODataV4. The URL you state is for Dynamics 365 Finance and Operation (the former Axapta or AX) - NOT for Business Central (the former Navision or NAV).
It is however true that Business Central also supports SOAP.
For Business Central OData support, see https://docs.microsoft.com/en-us/dynamics365/business-central/dev-itpro/webservices/odata-web-services
By the way - if you want to test it yourself, I have a blog post with a powershell doing edit/delete/insert of Customers here: https://scblog.lynge.org/?p=1105 (unfortunately it is in danish, but the powershell is english).
Best Regards,
Gert Lynge6
Answers
-
Hi
OData is designed for consuming data, not to handle (edit/delete/isnert) the data.
Have a look at this spec,
https://docs.microsoft.com/en-us/dynamics365/fin-ops-core/dev-itpro/data-entities/odata
You can use SOAP or REST API
https://docs.microsoft.com/en-us/dynamics-nav/api-reference/v1.0/enabling-apis-for-dynamics-nav0 -
Hi vremeni4
I know this a a bit of an old post, but what you state is incorrect.
Business Central supports edit/delete/insert via OData or ODataV4. The URL you state is for Dynamics 365 Finance and Operation (the former Axapta or AX) - NOT for Business Central (the former Navision or NAV).
It is however true that Business Central also supports SOAP.
For Business Central OData support, see https://docs.microsoft.com/en-us/dynamics365/business-central/dev-itpro/webservices/odata-web-services
By the way - if you want to test it yourself, I have a blog post with a powershell doing edit/delete/insert of Customers here: https://scblog.lynge.org/?p=1105 (unfortunately it is in danish, but the powershell is english).
Best Regards,
Gert Lynge6 -
Hi Larshs
I know this a a bit of an old post, but just to give you an answer.
Page 518 is a read only page (property Editable=No). So that won't work for editing.
In regards to page 21 it should work.
You can try it from powershell as described here https://scblog.lynge.org/?p=1105 (this exact example uses page 21).
Best Regards,
Gert Lynge1 -
Thanks, Gert, and thanks for the link:-)
Br.
Lars1
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions