X++ code to get tree structure product category filter

 This code will help you to get tree structure filter for product category to filter data based on categories 

where ever you want example for reports and batch jobs.

Note :- You need to over ride the lookup of you contract class by using UI builder class use below code 

class BASProductCaregoryUIBuilder extends SysOperationAutomaticUIBuilder

{

    //private    category;

    private DialogField categoryDialogField;


    public void postBuild()

    {

        super();

        //get reference to custAccount dialog field

        categoryDialogField = this.bindInfo().getDialogField(this.dataContractObject(), methodStr(BASProductCategoryContract, parmCategory));


        //override the lookup method

        categoryDialogField.registerOverrideMethod(methodStr(FormStringControl, lookup), methodStr(BASProductCaregoryUIBuilder, lookupCategory), this);

    }


    private void lookupCategory(FormReferenceControl _formReferenceControl)

    {

        RetailGroupMemberLine::categoryLookup(_formReferenceControl);

    }


}

Comments

Popular posts from this blog

How to Create a wizard in x++ d365

X++ code to CREATE AND POST A TRADE AGREEMENT IN MICROSOFT DYNAMICS 365 in D365 F & O

x++ code to submit and approve and reject the invent movement workflow in d365 F&O