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

How to extend class BIHelper

(0) ShareShare
ReportReport
Posted on by 903

Hello all,

Is class BIHelper extendable ? My menu all is dimmed for extend.

pastedimage1606927390709v1.png

I want to add some code in method "populateSRSAnlysisEnum". Can help to show me how ?

Thanks,

I have the same question (0)
  • Suggested answer
    Gunjan Bhattachayya Profile Picture
    35,423 on at

    Hi Tony,

    You can't extend a class like most other objects in D365 F&O. You will need to do a CoC on this method.

    Please check here for details. 

  • Tony zhong Profile Picture
    903 on at

    Hi Gunjan,

    I see, ok. Can help me to find what is wrong then with my CoC ?

    [ExtensionOf(classStr(BIHelper))]

    final class MyBIHelper_Extension

    {

       public void populateSRSAnalysisEnums(CLRObject metadataProvider)

       {

           next populateSRSAnalysisEnums(CLRObject metadataProvider);

           ttsbegin;

           while select firstfast forupdate EnumName, EnumItemName, EnumItemValue, EnumItemLabel

                       from analysisEnums

           {

               SysDictEnum dictEnum = new SysDictEnum(enumName2Id(EnumName));

               //analysisEnums. dictEnum.value2Label(InventTrans.TransType);

           }

           ttscommit;

       }

    }

    It keep "shouting" an error in this statement "next populateSRSAnalysisEnums(CLRObject metadataProvider);"

    saying ")" expected in "metadataProvider", but I didn;t see any bracket missing.

    Thanks

  • Suggested answer
    Gunjan Bhattachayya Profile Picture
    35,423 on at

    Hi Tony,

    It should be -

    next populateSRSAnalysisEnums(metadataProvider);

    Please check with this statement and see if that resolves your issue.

  • Suggested answer
    nmaenpaa Profile Picture
    101,166 Moderator on at

    As mentioned by Gunjan, you must call the next populateSRSAnalysisEnums method by passing the metadataProvider variable. When calling methods, you should not declare the types of the parameters in the call. Just pass the variables.

  • Tony zhong Profile Picture
    903 on at

    Hi Gunjan,

    Thanks it works. So I do not need to specify the datatype again it seems.

    Btw, probably need for more guidance. Actualy the intention is to add some logic to update the EnumItemLabel in table SRSAnalysisEnums.

    However I don't know how the code supposed to be.

    Appreciate if you could help.

    Thanks,

  • Gunjan Bhattachayya Profile Picture
    35,423 on at

    Hi Tony,

    Do you need to update the value of EnumItemLabel all the records in SRSAnalysisEnums table? If yes, what do you want to update it with?

  • Tony zhong Profile Picture
    903 on at

    Hi,

    Yes, need to for my BI report. Not really all, but I'm thinking it is even more confuse if we should select the one we need, might as well all of it.

    Supposedly, it will takes the label specified in those Enum properties, right?

    I don;t know why Microsoft decided to "not" populate this column at first place. It has the remarks saying no need to do that at the moment. But this class and method already around since F&O started (maybe since AX), there is no "willingness" to populate this, it seems. So I need to extend this.

    My needs actually only things like InventTransType. It doesn;t looks good in my report if showing the name like "InventCounting", "InventProfitLoss", etc. But there is some of my customs enums also that I have specified the label as well, but then again with the standard class, it is skip to populate.

    Thanks.

  • Verified answer
    Gunjan Bhattachayya Profile Picture
    35,423 on at

    Hi Tony,

    You can update all the values in the table using this method -

    [ExtensionOf(classStr(BIHelper))]
    final class MyBIHelper_Extension
    {
       public void populateSRSAnalysisEnums(CLRObject metadataProvider)
       {
           next populateSRSAnalysisEnums(metadataProvider);
    
           ttsbegin;
           while select forupdate analysisEnums
           {
                SysDictEnum dictEnum = new SysDictEnum(enumName2Id(EnumName));
                
                analysisEnums.EnumItemLabel = dictEnum.index2Label(analysisEnums.EnumItemValue);
                analysisEnums.update();
           }
           ttscommit;
       }
    }

  • Suggested answer
    nmaenpaa Profile Picture
    101,166 Moderator on at

    Gunjan's suggestion works if you need translations only in one language. If you need multiple languages, then you need to create new records in the table.

  • Tony zhong Profile Picture
    903 on at

    Hi Both,

    Thank you for all the good advice. Noted on the language issue, but I guess English as the international language will be acceptable.

    However, one last thing though. Has no error on the extension, and Build and Synchronized successfully. Wondering when and what action actually run this class ?

    I tried to Refresh one of my entity store, but the table has not updated. Should I run the class (BIHelper) manually ? I think the other day I found a way to run this from browser, but I would like to know the normal way first.

    Thanks,

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 669

#2
André Arnaud de Calavon Profile Picture

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

#3
Syed Haris Shah Profile Picture

Syed Haris Shah 331 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans