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 :
Finance | Project Operations, Human Resources, ...
Answered

Changing the default value of the category hierarchy in the form RetailReleasedProductsByCategory

(2) ShareShare
ReportReport
Posted on by 339
I want to be able to edit the standard Category Hierarchy on the form Released Product details (menu item = RetailReleasedProductsByCategory)
 
I added the following code:
[ExtensionOf(formStr(EcoResProductDetailsExtended))]
final class Form_EcoResProductDetailsExtended_Extension
{
    public void init()
    {
        next init();
        this.test();
    }

    private void test()
    {
        FormReferenceGroupControl test = this.CategoryHierarchyReferenceGroup;
        test.value(5637145326);
        test.modified();
    }
}
5637145326 is the recId of one of my records of the table EcoResCategoryHierarchy.
This should be valid, as I can validate via a breakpoint that the value of the control (before I modify it) corresponds with the recId of another record in the table. 
 
Despite this, during the modified call (which I call so the tree would get refreshed based on my chosen EcoResCategoryHierarchy), when the method getCategoryHierarchy is called, categoryHierarchyReferenceGroup.value() returns 0....
This can be seen with a breakpoint in the find method of the EcoResCategoryHierarchy table.
Does anyone know why this is the case and how I can fix it so I can set a default value of the category hierarchy tree?
Categories:
I have the same question (0)
  • Verified answer
    André Arnaud de Calavon Profile Picture
    303,915 Super User 2026 Season 1 on at
    Hi Superbunny,

    There is a setting in the application where you can specify the default retail hierarchy that will be used when opening the form. Would this be an option instead of a customization?

    Have you tried calling element.initializeCategoryTree() instead of the modified() method?
     
  • Superbunny Profile Picture
    339 on at
    Thank you for your reply @André.
     
    Calling initializeCategoryTree instead of modified did the trick, so I will mark the question as the answer.
     
    I am however, still interested in where the default retail hierarchy setting could be set, as my functional colleague had not found this option within the system
  • André Arnaud de Calavon Profile Picture
    303,915 Super User 2026 Season 1 on at
    Hi Superbunny,

    From the Category hierarchies form you can click on Associate hierarchy type. On that form, you can set one hierarchy with the type Commerce product hierarchy. See screenshot below. That is used as the default retail hierarchy.
     

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 March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 692

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 454 Super User 2026 Season 1

#3
Syed Haris Shah Profile Picture

Syed Haris Shah 311 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans