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, ...
Unanswered

ClassDoesNotContainMethod

(0) ShareShare
ReportReport
Posted on by 4

Hi All,

I'm trying to add an event handler for ViewEdit mode changed on any standard form, the following code works fine on any custom form, now trying to achieve the same on standard forms, here VendTable.

The simplified version of code is unable to compile:

[ExtensionOf(FormStr(VendTable))]
final class VendTable_Extension
{
    public void OnViewEditModeChanged()
    {
        //DOSomething
    }

    public void init()
    {
        next init();
        this.viewEditModeHelper().EditModeSwitched  = eventhandler(this.OnViewEditModeChanged);
        this.viewEditModeHelper().ViewModeSwitched  = eventhandler(this.OnViewEditModeChanged);
    }

}

This code produces the following compiler error:

Error ClassDoesNotContainMethod: Form 'Dynamics.AX.Application.VendTable' does not contain a definition for method 'OnViewEditModeChanged' and no extension method 'OnViewEditModeChanged' accepting a first argument of type 'Dynamics.AX.Application.VendTable' is found on any extension class. 

When running the same on a custom form, compiler has no issues:

[Form]
public class AAATest extends FormRun
{
    public void OnViewEditModeChanged()
    {
        //DOSomething
    }

    public void init()
    {
        super();
        this.viewEditModeHelper().EditModeSwitched  = eventhandler(this.OnViewEditModeChanged);
        this.viewEditModeHelper().ViewModeSwitched  = eventhandler(this.OnViewEditModeChanged);
    }

}

The only difference I can notice is the use of COC on a standard form versus using a custom form without COC.

Happy to discuss, Thanks

I have the same question (0)
  • Martin Dráb Profile Picture
    238,782 Most Valuable Professional on at

    I ran into something similar. I solved it by putting the event handler method to a class, rather then directly to the form.

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!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

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

#1
André Arnaud de Calavon Profile Picture

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

#2
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 386

#3
Adis Profile Picture

Adis 259 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans