web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Suggested Answer

Errors trying to update Purchase Order via OData

(0) ShareShare
ReportReport
Posted on by 5

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

I have the same question (0)
  • Suggested answer
    YUN ZHU Profile Picture
    101,846 Super User 2026 Season 1 on at

    Hi, Similar to the following question.

       

    But please note that if you publish a standard Purchase Order list, it cannot be edited, and the following error may appear.

    pastedimage1684889901635v2.png

    If you insist on using Odata, I suggest you create a new page.

    Below is a simple example of a Sales Order.

    page 50011 "ZY Sales Orders"
    {
        ApplicationArea = All;
        Caption = 'ZY Sales Orders';
        PageType = List;
        SourceTable = "Sales Header";
        UsageCategory = Lists;
    
        layout
        {
            area(content)
            {
                repeater(General)
                {
                    field("Document Type"; Rec."Document Type")
                    {
                        ToolTip = 'Specifies the value of the Document Type field.';
                    }
                    field("No."; Rec."No.")
                    {
                        ToolTip = 'Specifies the number of the estimate.';
                    }
                    field("Sell-to Customer No."; Rec."Sell-to Customer No.")
                    {
                        ToolTip = 'Specifies the number of the customer associated with the sales return.';
                    }
                    field("Posting Date"; Rec."Posting Date")
                    {
                        ToolTip = 'Specifies the date when the sales document was posted.';
                    }
                    field("Ship-to Code"; Rec."Ship-to Code")
                    {
                        ToolTip = 'Specifies the code for another shipment address than the customer''s own address, which is entered by default.';
                    }
                }
            }
        }
    }
    

    pastedimage1684889925520v3.png

    api.businesscentral.dynamics.com/.../ZYNewSalesOrders(Document_Type='Order',No='101001')

    pastedimage1684889941807v4.png

    pastedimage1684889955771v5.png

    pastedimage1684889977611v6.png

    Hope this can give you some hints.

    Thanks.

    ZHU

  • Suggested answer
    Saurav.Dhyani Profile Picture
    14,419 User Group Leader on at

    Hope this helps

    [View:https://youtu.be/TSQiE42tDwU:320:240]

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,466 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,829 Super User 2026 Season 1

#3
AndrewThomas81 Profile Picture

AndrewThomas81 1,505

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans