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)

How To call super () in class extension in D365

(0) ShareShare
ReportReport
Posted on by

Hi All,

I want to call the super in class extension .

Ex:super(_formControl, _filterStr);

How to I call this code in Extension Class.

It Would be great for your replay

Thanks

Arun Joseph A

*This post is locked for comments

I have the same question (0)
  • Jose Fuentes Profile Picture
    140 on at
    RE: How To call super () in class extension in D365

    Hi Arun

    If you extend a class you can override the functions, for example when you develop reports you extend the SRSReportDataProviderBase when you create  your DP Class and override processReport() method.

    The next may help you.

    Noticed that both functions must have the same sign (parameters)

    Class Main()

    {

    public void mainfunction(VendAccount _account)

    {

    // Do something for main function

    }

    }

    Class Child extends Main

    {

    public void mainfunction(VendAccount _account)

    {

    super();//execute the mainfunction for mainclass

    // Do something for child function

    }

    }

    I hope this is what you are searching.

    Regards

    Jose Fuentes

  • Community Member Profile Picture
    on at
    RE: How To call super () in class extension in D365

    Hi Jose ,

    Thanks for your reply.

    For my Scenario:

    public int active()

           {

               int ret;

               ret = super();

               return ret;

           }

    I want to Create the Extension class in D 365:

    In extension class it did not to allow the super() call.

    when I declare the super() its throws error in extension class.

    Please help !

    Thanks

    Arun Joseph A

  • Community Member Profile Picture
    on at
    RE: How To call super () in class extension in D365

    Thanks

    How to declare the super() in extension class.

    Is there another way to call super() in class extension in D 365.

    For EX:

    [FormDataSourceEventHandler(formDataSourceStr(LedgerJournalTransCustPaym, LedgerJournalTrans), FormDataSourceEventType::ValidatingWrite)]

       public static void LedgerJournalTrans_OnValidatingWrite(FormDataSource sender, FormDataSourceEventArgs e)

       {

           Super()// super not allowed here...

       }

  • Jose Fuentes Profile Picture
    140 on at
    RE: How To call super () in class extension in D365

    Hi Arun

    For what type of object do you want to create this class? Form, Table or another class?

    If is a class the example that I've posted may help you, but it is another type of object you have to use eventhandlers, obviously the function will execute after or before (I think that would be the "super()" function that you are searching), depending of the event,

    You may check next post

    community.dynamics.com/.../ax7-extensibility-part-3-event-handlers-and-delegates-hooks

    Regards.

    Jose

  • Community Member Profile Picture
    on at
    RE: How To call super () in class extension in D365

    Thank You.

    Ya its throwing error.

    public int active()
    {
    int ret;

    if (mcrAllowPayment)
    {
       // Written some business logic
    }

    ret = super();

    if (ret)

    {

         //Extension code .. call event handler extension class

    }

    In This how it will possible.

    [FormDataSourceEventHandler(formDataSourceStr(LedgerJournalTransCustPaym, LedgerJournalTrans), FormDataSourceEventType::Activated)]
    public static void LedgerJournalTrans_OnActivated(FormDataSource sender, FormDataSourceEventArgs e)
    {

      // How can i call here. if super extecuted here:

     CustVendNACHAIATInfoTable_US.enabled(CustOutPaym_NACHA_IAT::isIATNACHAFormat(ledgerJournalTrans.PaymMode)); // this code want to executed.
    }

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
Priya_K Profile Picture

Priya_K 4

#2
Alexey Lekanov Profile Picture

Alexey Lekanov 3

#3
Scott_itD Profile Picture

Scott_itD 2 Community Manager

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans