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

Can I create methods on table extensions?

(0) ShareShare
ReportReport
Posted on by 845
  • Verified answer
    Martin Dráb Profile Picture
    241,434 Most Valuable Professional on at

    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,845 Moderator on at

    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
    845 on at

    OK, Thanks for sugestions.

    Do the new display methods created need to be static?

  • GirishS Profile Picture
    27,845 Moderator on at

    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
    241,434 Most Valuable Professional on at

    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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the August Top 10 Community Leaders

These are the community rock stars!

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

#1
Martin Dráb Profile Picture

Martin Dráb 536 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 363 Super User 2026 Season 2

#3
CU-1234529-002 Profile Picture

CU-1234529-002 188

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans