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

Notifications

Announcements

No record found.

Community site session details

Community site session details

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

Setting Parent Category via the api

(3) ShareShare
ReportReport
Posted on by 8

Hi,

I'm quite new to Business Central, but I need to be able to set the parent category via the API. I can create the categories, but not assign a parent.

I understand that I need to create a custom API endpoint to do that, which I’ve tried — but it seems to ignore my extension. I’ve played around with a few different AL files, but with no success!

I’ve been reading the Microsoft documentation, and while it seems straightforward to add a new item, I'm not sure how to expose an existing field like the parent category.

Any pointers would be greatly appreciated!

I have the same question (0)
  • Suggested answer
    YUN ZHU Profile Picture
    95,763 Super User 2025 Season 2 on at
    Hi, You can copy the standard code below and add your new fields.
    PS: Dynamics 365 Business Central: Can we extend standard APIs? – Download Standard Source Code for APIs
     
    Hope this can give you some hints.
    Thanks.
    ZHU
  • Gerardo Rentería García Profile Picture
    25,390 Most Valuable Professional on at
  • Suggested answer
    Khushbu Rajvi. Profile Picture
    20,962 Super User 2025 Season 2 on at
  • Suggested answer
    Sohail Ahmed Profile Picture
    11,150 Super User 2025 Season 2 on at
    Maybe this will help you move forward.
     
    To set the Parent Category via API in Business Central, you're right — it’s not exposed in the default API, so you’ll need to:
     
    Steps:
     
    1. Extend the standard API page APIV2ItemCategories (Page ID: 5450) in your extension.
     
     
    2. Add the Parent Category field using addafter() or addlast() in your page extension.
     
     
    3. Make sure the Parent Category Code field is exposed as a GUID (SystemId) if you're working with the OData V4 endpoint.
     
     
    4. Publish your extension, and test using POST or PATCH to update the category.
     
     
     
    If your changes aren’t working:
     
    Double-check that your API page is marked with EntityName and EntitySetName.
     
    Make sure your modified page is included in the published app and is enabled in the Web Services list.
     
     
    You can also review Microsoft’s base extension here for reference:
    https://github.com/microsoft/ALAppExtensions/blob/main/Apps/W1/APIV2/app/src/pages/APIV2ItemCategories.Page.al
     
    Mark below checkbox to make this answer Verified if it helps you.
     
     

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,116

#2
Khushbu Rajvi. Profile Picture

Khushbu Rajvi. 764 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 635 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans