web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

Can I create methods on table extensions?

(0) ShareShare
ReportReport
Posted on by 843
I have the same question (0)
  • Verified answer
    Martin Dráb Profile Picture
    236,907 Most Valuable Professional on at
    RE: Can I create methods on table extensions?

    You should follow the way described in your first link (utilizing ExtensionOf attribute). It's easier and more powerful.

    F&O (not AX 2012 or older) allows creating extension methods even before CoC and ExtensionOf attribute were introduced (as described on those other two links), but there isn't a reason for using it anymore.

  • Verified answer
    GirishS Profile Picture
    27,825 Moderator on at
    RE: Can I create methods on table extensions?

    Hi Shooowtek,

    Yes yo can create the table method via extension. You already posted the Microsoft documentation which explains about the rules which needs to be followed.

    For the 2nd and 3rd link, you can simply create the display method via extension and assign it to a form control - No need to mention like ExtensionClassName_Extension::MethodName.

    If you are still not clear, please elaborate your scenario you are trying to achieve. Based on that we can give you a suggestions.

    Thanks,

    Girish S.

  • Shooowtek Profile Picture
    843 on at
    RE: Can I create methods on table extensions?

    OK, Thanks for sugestions.

    Do the new display methods created need to be static?

  • GirishS Profile Picture
    27,825 Moderator on at
    RE: Can I create methods on table extensions?

    I think it need not be static - Static is mentioned in the display method because on the control property we need to call the method using ExtensionClassName_Extension::MethodName (Using Scope resolution operator). That's why it is declared as static.

    But in the latest version no need of mentioning the scope resolution operator on the form control. Just selecting the display method name is enough. So the display method need not to be static.

    Thanks,

    Girish S.

  • Martin Dráb Profile Picture
    236,907 Most Valuable Professional on at
    RE: Can I create methods on table extensions?

    The old extension methods (which shouldn't be used anymore must always be static), although they're actually related to an instance.

    When using the new approach (with ExtensionOf), use use static keyword to add static methods to the class (which isn't possible with the old approach) and no static keyword to declare instance methods (which is much more natural then the old way).

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Pallavi Phade – Community Spotlight

We are honored to recognize Pallavi Phade as our Community Spotlight honoree for…

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

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 684 Super User 2025 Season 2

#2
CA Neeraj Kumar Profile Picture

CA Neeraj Kumar 588

#3
Martin Dráb Profile Picture

Martin Dráb 542 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans