10 Apr’18

Dynamics 365, EnterpriseFetch Hierarchical data for Product Category in Dynamics 365 Operations

Introduction:

In this blog article, we will see how we can fetch hierarchical data using X++.

How to fetch?

We will take a scenario where we will pass a category hierarchy and will fetch all categories of that hierarchy and its child category.

public class ProductCategoryHierarchy
{
    EcoResCategory    category; 

    public void ParentCategory()
    {       
        while select category where category.CategoryHierarchy == “Brands”
        {
            //code
            this.getChildrenCategory(category.RecId);
        }      
    }
    /// <summary>
    /// get categories of child product
    /// </summary>
    public void getChildrenCategory(EcoResCategoryId ParentCategory)
    {
        while select category where category.ParentCategory == ParentCategory
        {
            //code
            this.getChildrenCategory(category.RecId);
        }  
    }
 }
Written by

Sohagani Shah

ERP Developer

Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload the CAPTCHA.

Want to streamline your business processes?

  • This field is for validation purposes and should be left unchanged.

Recent Articles

  • Design Views in App Designer – D365

    11 April’ 2018

    Introduction: Create and edit public or system views by using the app designer Description: Dynamics 365 sales app des...

    Read more
  • Call Management in D365 Field Service

    10 April’ 2018

    Introduction: This blog provides a solution to requirement of Client for Call Management in D365 Field Service. Scenari...

    Read more
  • Fetch Hierarchical data for Product Category in Dynamics 365 Operations

    10 April’ 2018

    Introduction: In this blog article, we will see how we can fetch hierarchical data using X++. How to fetch? We will ta...

    Read more
  • PowerBI April 2018 Update: Combo Chart Line Formatting

    10 April’ 2018

    Introduction: PowerBI introduced the feature to format line styles and legends for line charts a while ago. However, th...

    Read more
  • Power BI April 2018 Update: Q&A Explorer

    10 April’ 2018

    Introduction: In this blog we will explore some of the new features added to Power BI. Power BI has upgraded its Q&...

    Read more