Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

RegisterOverrideMethod was called twice for the same object for method 'validate'. You can only override a method once per instance.

(0) ShareShare
ReportReport
Posted on by 2,457

If I am validating two runtime dialog fields of type FormIntControl using same Validate method , I am getting error as RegisterOverrideMethod was called twice for the same object for method 'validate'. You can only override a method once per instance. Is there any way to bypass this issue as i want to use same validate method for both the fields.

Please help me to get out of this issue

*This post is locked for comments

  • RE: RegisterOverrideMethod was called twice for the same object for method 'validate'. You can only override a method once per instance.

    Hi All,

    I have resolved this issue by adding below method in class. It is mandatory to comment super.

       // PostRun Method

       public void postRun()

       {

           //super();

       }

  • Lakshmi Karambakkam Profile Picture
    Lakshmi Karambakkam 1,293 on at
    RE: RegisterOverrideMethod was called twice for the same object for method 'validate'. You can only override a method once per instance.

    Hi Ali,

    I have the same error message as I am using registeroverridemethod more than once (infact thrice).

    Did you find a solution?

    Commenting super() did not work for me.

    dfBOMId = this.bindInfo().getDialogField(contract, methodStr(KittingContract, parmBOMID));
    dfBOMId.registerOverrideMethod(methodStr(FormStringControl, lookup), methodStr(KittingReportUIBuilder, BOMIdLookup), this);
    if (dfBOMId){
    dfBOMId.lookupButton(1);
    }
    //Warehouse
    dfWarehouse = this.bindInfo().getDialogField(contract, methodStr(KittingContract, parmWarehouse));
    dfWarehouse.registerOverrideMethod(methodStr(FormStringControl, lookup), methodStr(KittingReportUIBuilder, WarehouseLookup), this);
    if (dfWarehouse){
    dfWarehouse.lookupButton(2);
    }
    //Kit Levels
    dfKitLevels = this.bindInfo().getDialogField(contract, methodStr(KittingContract, parmKitLevels));
    dfKitLevels.registerOverrideMethod(methodStr(FormStringControl, lookup), methodStr(KittingReportUIBuilder, KitLevelsLookup), this);
    if (dfKitLevels){
    dfKitLevels.lookupButton(3);

    Thanks,

    lakshmi

  • Ragoza Oleksandr Profile Picture
    Ragoza Oleksandr 735 on at
    RE: RegisterOverrideMethod was called twice for the same object for method 'validate'. You can only override a method once per instance.

    Ok, Raziq,

    Thank you for advice,

    Oleksandr

  • Mohammad Raziq Ali Profile Picture
    Mohammad Raziq Ali 2,457 on at
    RE: RegisterOverrideMethod was called twice for the same object for method 'validate'. You can only override a method once per instance.

    Hi Oleksandr,

    One suggestion for you is try to  category the code  with respect to method.

    Don't put all code in one method that is not recommended and would not help in debugging.

    Thanks,

    Raziq

  • Suggested answer
    Ragoza Oleksandr Profile Picture
    Ragoza Oleksandr 735 on at
    RE: RegisterOverrideMethod was called twice for the same object for method 'validate'. You can only override a method once per instance.

    Hi Raziq, I have found to solution in this post dynamicsaxinsight.wordpress.com/.../ax-2012-multi-select-lookup-for-ssrs-report-dialog

    So I have done only one thing: postRun() method overridden to comment out super() method call.

    super() is commented to avoid the following exception:

    RegisterOverrideMethod was called twice for the same object for method ‘lookup’…

    Let me know if you still need my UIBuilder. Oleksandr

  • Mohammad Raziq Ali Profile Picture
    Mohammad Raziq Ali 2,457 on at
    RE: RegisterOverrideMethod was called twice for the same object for method 'validate'. You can only override a method once per instance.

    Hi Ragoza Oleksandr,

     

    Could you please share your whole UI Builder class code. The reason why I am asking this is, you called to registeroverridemethod only once in this piece of code.

     

    Please share it for further trouble shooting.

     

    Thanks,

    Raziq

  • Ragoza Oleksandr Profile Picture
    Ragoza Oleksandr 735 on at
    RE: RegisterOverrideMethod was called twice for the same object for method 'validate'. You can only override a method once per instance.

    Hi Mohd, please see below:

    class ReportUIBuilder extends SrsReportDataContractUIBuilder

    {

       DialogField                  dialogFieldCategory,

                                    dialogFieldMonthQuarter,

                                    dialogFieldFromDate,

                                    dialogFieldToDate,

                                    dialogFieldReportDate;

       ReportContract insuranceReportContract;

    }

    public void postRun()

    {

       Dialog dialogLocal                    = this.dialog();

       ReportContract contract = this.dataContractObject();

       super();

       dialogFieldCategory     = this.bindInfo().getDialogField(this.dataContractObject(), methodStr(ReportContract, parmCategoryList));

       dialogFieldMonthQuarter = this.bindInfo().getDialogField(this.dataContractObject(), methodStr(ReportContract, parmMonthQuarter));

       dialogFieldReportDate   = this.bindInfo().getDialogField(this.dataContractObject(), methodStr(ReportContract, parmReportDate));

       dialogFieldFromDate     = this.bindInfo().getDialogField(this.dataContractObject(), methodStr(ReportContract, parmFromDate));

       dialogFieldToDate       = this.bindInfo().getDialogField(this.dataContractObject(), methodStr(ReportContract, parmToDate));

       dialogFieldCategory.registerOverrideMethod(methodstr(FormStringControl, lookup), methodstr(ReportUIBuilder, categoryLookup), this);

       dialogFieldFromDate.allowEdit(false);

       dialogFieldToDate.allowEdit(false);

    }

  • Mohammad Raziq Ali Profile Picture
    Mohammad Raziq Ali 2,457 on at
    RE: RegisterOverrideMethod was called twice for the same object for method 'validate'. You can only override a method once per instance.

    Hi Ragoza,

    Please share your code with us.

    Thanks,

    Raziq

  • Ragoza Oleksandr Profile Picture
    Ragoza Oleksandr 735 on at
    RE: RegisterOverrideMethod was called twice for the same object for method 'validate'. You can only override a method once per instance.

    Hello Mohd Raziq Ali, hello Lalit Jivnani,

    I have the same problem, can you please share the code with me as well. Thanks

  • Mohammad Raziq Ali Profile Picture
    Mohammad Raziq Ali 2,457 on at
    RE: RegisterOverrideMethod was called twice for the same object for method 'validate'. You can only override a method once per instance.

    Hi Latin,

    Can you share your code.

    Thanks,

    Raziq

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,516 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,409 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans