Skip to main content

Notifications

Dynamics 365 general forum

Override "Modified" method in dialog

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hey guys,

I was wondering if anyone faced the same issue in D365.

I actually have a dialog (Runbase) where i want to override the "modified" method for a dialog field, So i used the "Register Override Method" just like i did to override a lookup (that is working just fine).

Here is my code that i'm naturally placing in the "Dialog" Method of the class : 

DialogField.registerOverrideMethod(methodStr(FormStringControl, modified),methodStr(MyClass, MyMethod), this);

The issue here is that my method "MyMethod" is working and the code inside is executed correctly, but when i change the value of the field and i leave the field, i get this : 

3173.SCSHOT.jpg

Categories:
  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Override "Modified" method in dialog

    Hi Dmitry,

    it actually helped me haha :)

    Thank you for your time.

  • Verified answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Override "Modified" method in dialog

    Hi GoProX,

    It's quite a time from your question but still can help others.

    The probably answer is you have to return true in your override method.

    it should looks like:

    class MyClass
    {
        private boolean myMethod(FormStringControl _control)
        {
            boolean ret = _control.modify(); //instead of super() if you need it.
            //place your code here.
            return ret;
        }
    }


     

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Override "Modified" method in dialog

    Yeah i've tried to override the validate method too to make it return true just to be sure if it's the validate that is responsible of this. still facing the same problem.

    And like i said, it works with no problem for other methods, it's just the "modified" that gets stuck

  • Mea_ Profile Picture
    Mea_ 60,278 on at
    RE: Override "Modified" method in dialog

    It's hard to say what is wrong without seeing actual code. Warning that AX shows you is caused by validate method not returning true, so you need to figure out if validated is called and if it returns true.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Override "Modified" method in dialog

    Hi Ievgen,

    Yes i'm already calling it in my method as you said. did it ever work for you in AX 7 ?

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Override "Modified" method in dialog

    Hi Mohammad,

    In my case i'm passing 'this' it's the same here.

  • Suggested answer
    Mea_ Profile Picture
    Mea_ 60,278 on at
    RE: Override "Modified" method in dialog

    Hi GoProX,

    MyClass.MyMethod accepts FormStringControl  as a parameter, lets say FormStringControl _control.

    You need to call _control.modified();

    in MyClass.MyMethod to trigger actual modification, so it will act as a super().

  • Suggested answer
    Basheer17 Profile Picture
    Basheer17 2,720 on at
    RE: Override "Modified" method in dialog

    Hi GoProX,

    In your code registerOverrideMethod method's last parameter should be your MyClass object.

  • Suggested answer
    Sukrut Parab Profile Picture
    Sukrut Parab 71,673 Moderator on at
    RE: Override "Modified" method in dialog

    Are you using SysOperationframework ?  Use UI builder class there you will see postRun ,PostBuild method.

    Look at class PurchReqStatisticsUIBuilder  to see example.

    community.dynamics.com/.../using-ui-builder-class-to-develop-ssrs-reports-in-microsoft-dynamics-ax-2012

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Override "Modified" method in dialog

    Thanks for the reply,

    There is no "PostRun" method, only "DialogPostRun" and i tried that, still not working.

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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,996 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,853 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans