Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX (Archived)

Extension classes

Posted on by 362

Hi Friends,

I have a scenario where i need to subscribe to the table events, form data source events and form control events eg: Button Clicked event. Could you please help me in knowing what is the best practice from the extension class creation point of view. My doubt is do i need to copy all the events w.r.t table,form data source and form control in one extension class only or i need to create a new extension class for the each scenario accordingly.

Regards

Venky   

*This post is locked for comments

  • Fedir Kryvyi Profile Picture
    Fedir Kryvyi 1,026 on at
    RE: Extension classes

    Please, do not forget to check "Did this answer your question?" to mark you question as answered. Thx!

  • Suggested answer
    Fedir Kryvyi Profile Picture
    Fedir Kryvyi 1,026 on at
    RE: Extension classes

    This is solely depends on your companies dev-standards and naming conventions.

    I would suggest(and it seems that it is a common case) to create a new class for each scenario.

    MS uses EventHandler prefix to name their classes, like: smmActivityAdvancedPromptEventHandler. But that is not the optimal solution in some cases.

    Let's say we have SalesTable table and form, and we need handler for both events on table, datasource on the form and UI

    I would suggest to have something like:

    SalesTable_Table_EventHandler

    SalesTable_Table_Extension(if needed)

    SalesTable_Form_EventHandler

    SalesTable_Form_Extension(if needed)

    In this case it is easy to differentiate between code.

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans