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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Adding a customized method of a standard form on a class extension

(0) ShareShare
ReportReport
Posted on by 230

This is in Ax 7. We have customized a standard form and added a new method to it. I want to move that method out of that form. The approach we are taking is creating an extension class and keeping the method on it. I have tried creating a new extension class and put the customized method in it, however class extension is not allowing to move a completely new customized method in it. Please share some light on how to add a customized method for a form on a class extension.

Attaching screenshot for more clarity. 

28220.Capture.JPG

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Martin Dráb Profile Picture
    237,801 Most Valuable Professional on at

    The error clearly says that you forgot to specify the method parameter, which is mandatory if you're creating an extension method.

    But the better solution is using an extension class instead. Yes, extension methods (in AX 7 from the beginning) and class extensions (added in Platform Update 1) are two different things, although closely related. Your title suggests that you intended to create a class extension, but you'll have to fix a few things to get there.

    1. Change the class from static to final
    2. Decorate it with ExtensionOf attribute
    3. Change the method to non-static

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…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans