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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

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

Table extension fields standard API header field sets correctly, detail field does not set.

(9) ShareShare
ReportReport
Posted on by 18
I have created two table extensions in AL for boolean fields, one for table 38 Purchase Header and one for table 39 Purchase Line. I've added those fields to my page extension and they both show up on the page Purchase Invoice. When I do a POST request in Postman for Purchase Header, this new field sets correctly. When I do a POST request in Postman for the Purchase Line, there is no error and the record is inserted but does not set the boolean field at all. There are no errors. Pretty simple field and passing true for both but only the Purchase Header sets true for the new custom field. Why would one set fine but not the other? Is there a difference? I am using the standard api for both. Don't know why one would work and not the other?
I have the same question (0)
  • Suggested answer
    YUN ZHU Profile Picture
    100,471 Super User 2026 Season 1 on at
    As of now, standard APIs are not extensible, even if you add fields to the page. Because the API Page is a separate page, you can't add fields at the same time.
    Dynamics 365 Business Central: Can we extend standard APIs? – Download Standard Source Code for APIs
     
    n addition, in future versions, BC standard pages will not be able to be published as Web Services.
     
    Hope this helps.
    Thanks.
    ZHU
  • Suggested answer
    Sohail Ahmed Profile Picture
    11,175 Super User 2026 Season 1 on at
    As of now, standard APIs are not extensibl
  • Suggested answer
    Sumit Singh Profile Picture
    11,795 Super User 2026 Season 1 on at
    Hi, 
     
    Sharing few official links which might help:- 
     
     
     
    Mark the Boolean true “Does this answer your Question” if this was Helpful.
  • Suggested answer
    Khushbu Rajvi. Profile Picture
    22,350 Super User 2026 Season 1 on at
    Standard APIs in Business Central are not extensible. That’s why your header field seemed to “work,” but your line field didn’t. The correct way is to create a custom API page
  • YM-02091915-0 Profile Picture
    67 on at
    Thank you, everyone for the help. I have decided to go to custom api route. I said the wrong terminology at first. I apologize. I was not using standard api. I was using the page ui endpoints. I still would like to know why it would fail to set my custom field? The web service page endpoints I was using was Page object 51 Purchase Invoice and Page object 55 Lines. Object 51 set my custom field fine, but Object 55 ui page endpoint would not fail but not set the custom field. I am moving out of using the page ui endpoints as Yun Zhu stated they would be obsolete soon.

    After changing my Page UI endpoints to my custom api endpoints. I get a new error. Again the Purchase Invoice custom api sets my custom boolean field correctly, but I get now for my custom api for the Lines.
     
        "error": {
            "code": "Internal_InvalidTableRelation",
            "message": "The field Document No. of table Purchase Line contains a value (108179) that cannot be found in the related table (Purchase Header). 
     
    Thank you everyone for helping. Yun Zhu your articles I have been following for a couple years now. Always have been very helpful. Thank you for the links. Thank you Sohail, Sumit, and Khushbu as well for your responses.
  • Suggested answer
    YUN ZHU Profile Picture
    100,471 Super User 2026 Season 1 on at
    Hi, from the error message
    "message": "The field Document No. of table Purchase Line contains a value (108179) that cannot be found in the related table (Purchase Header). 
    It seems to be a problem with the code. I hope the following discussion can give you some hints.
     
     
    Thanks
    ZHU
  • YM-02091915-0 Profile Picture
    67 on at
    Thank you Yun, I did read that but I get this error not in code, but in Postman, running a POST request. I am not using a codeunit? Wonder how the same error could happen here as he fixed it with changing his code, wonder what I need to do to fix this in Postman? I am also creating a Purchase Invoice (header record which does return 201 Created) first. Then I try to execute the Purchase Lines using the document id 108179. Here is my body in my POST request:
     
     
    {
        "type": "Item",
        "documentType": "Invoice",
        "documentNo": "108179",
        "buyFromVendorNo": "10000",
        "directUnitCost": 780.7,
        "lineAmount": 780.7,
        "no": "1896-S",
        "quantity": 1,
        "unitCost": 780.7
    }
     
  • Verified answer
    YM-02091915-0 Profile Picture
    67 on at
    The fix was the order of the fields in the custom api page. I had to sort by ID not Name in the AZ AL Dev Tools wizard when creating my page. By default it is sorted by the name and the fields were created in the wrong order. But order of the fields on creation of the custom api page matters. I wonder why by default it is sorted by name not id in api creation, but now I know! thank you everyone!
  • Suggested answer
    Cenzo Profile Picture
    336 on at
    The issue of the boolean field in the Purchase Line (table 39) not setting properly via the standard API POST request whereas the Purchase Header (table 38) field sets correctly is commonly linked to how standard APIs in Dynamics 365 Business Central expose and accept updates on table extension fields.
    Standard API might not expose the custom field on Purchase Line: Unlike Purchase Header, some standard APIs for lines do not automatically include new custom fields in the API page or entity. So even if the field exists in the table extension and shows on the page, it might never be mapped into the API response/request.
    Field not included in API page or entity: To have the field settable in the API call, the API page for Purchase Line must be extended to explicitly include this new boolean field.
    No errors on POST is typical: The API silently ignores unknown fields if they are not defined in the API page, so no errors occur but changes aren't applied.
     
    pageextension 50100 PurchaseLineApiExt extends "Purchase Line API"
    {
        layout
        {
            addlast(Content)
            {
                field(CustomBooleanField; Rec.MyCustomBooleanField)
                {
                    Caption = 'My Custom Boolean Field';
                }
            }
        }
    }
     
  • Suggested answer
    YUN ZHU Profile Picture
    100,471 Super User 2026 Season 1 on at
    Glad you solved the problem.
    The AZ AL Dev Tools wizard is just a third-party tool, and while it's very convenient, sometimes it's good to check it out.
     
    Thanks.
    ZHU

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

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,072 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,129 Super User 2026 Season 1

#3
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 650 Most Valuable Professional

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans