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

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Using control controlMethodOverload for formControls with long names

(0) ShareShare
ReportReport
Posted on by 955

While in AX2009 does not have registerOverrideMethod. Previously it was commonly used practice overriding form controls methods using following patern:

Let's assume example form CustInvoiceJournal Init (add following two lines to the end of init):

element.controlMethodOverload(true);

element.controlMethodOverloadObject(new CustInvoiceJournalCtrlOverload(this));

 

In CustInvoiceJournalCtrlOverload class all control overrides are in following pattern

controlName_methodName. Example CustInvoiceJour_InvoiceAccount_Modified 

whole CustInvoiceJournalCtrlOverload class blueprint

class CustInvoiceJournalCtrlOverload 
{
   FormRun element;
}
void CustInvoiceJour_InvoiceAccount_Modified ()
{
   info("test");
}

And this works like a charm. Except if a control name which I want to override is very long for example groupInterCompany_InterCompanyCompanyId. If I try to create method groupInterCompany_InterCompanyCompanyId_modified I am getting compiler error "Name is too long. Truncate name to groupInterCompany_InterCompanyCompanyId_." Does somebody have a clue how to overcome this issue?

*This post is locked for comments

I have the same question (0)
  • Denis Macchinetti Profile Picture
    16,444 on at
    RE: Using control controlMethodOverload for formControls with long names

    Hi Vukis

    As per my knowledge, the unique solution is give a more short name to the form control.

    The name of a method can't be higher than 40 characters.

    Take a look at msdn.microsoft.com/.../aa632638.aspx

  • Lauras U Profile Picture
    955 on at
    RE: Using control controlMethodOverload for formControls with long names

    You are right that they should be shorter. But this is not a case of my inquiry. As I said in example I am working on [SYS] form which has it's controls named by MS. And I wan't to override control that is in SYS layer without changing it's name.

    I can't also guarantee that this 40 chars suggestion was meant for form controls as even dragging fields in form from DS to Design generates longer names.

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…

Pallavi Phade – Community Spotlight

We are honored to recognize Pallavi Phade as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Tocauer Profile Picture

Martin Tocauer 4

#2
AlissonGodoy Profile Picture

AlissonGodoy 2

#2
Community Member Profile Picture

Community Member 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans