Hoping someone can give me a pointer on this.
Using Business Central Dynamics (hosted by MS), trying to update a Purchase Order custom field via a PUT or PATCH call with OData.
The field I am trying to update is a custom field we have added to the Purchase Order. I have created the OData server page for the Purchase Order page and the field is present in the results if I do a GET on the page.
The url I am calling is:
api.businesscentral.dynamics.com/.../<tenanat id>/<environment>/ODataV4/Company('<company name>')/PurchaseOrderPage?$filter=No eq '10201'
The json I am passing in is:
{ "Date_Sent_to_Vendor": 2023-05-01}
I have added the following headers to the call:
Content-Type : application/json
If-Match : W/"JzIwOzEzMjk3OTM3ODUwODE3MzIxMzM4MTswMDsn"
I do a GET right before the PATCH call to get the current eTag value to place in the If-Match header.
I am getting the dreaded:
'PATCH' requests for 'PurchaseOrderPage' of EdmType 'Collection' are not allowed within Dynamics 365 Business Central OData web services.
I have read all the other threads about making sure the If-Match is there with the current eTag but I am not able to get past this. All the other examples I have seen are for updating standard fields but nothing on updating a custom field.
Any help or advice would be greatly appreciated!
Thanks!
Bruce