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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

Override init method in CustTable form

(0) ShareShare
ReportReport
Posted on by 304

Hello,

It's my first time to use D365,

As part of the learning process I need to customize the init method in the data source of CustTable in the CustTable form

I'm aware of the extension concept, but no valuable practice yet, so I would appreciate any help or guide through this

Thanks

I have the same question (0)
  • Verified answer
    Gunjan Bhattachayya Profile Picture
    35,423 on at

    Hi Kareem,

    Please check the MS documentation on Chain of Command here to get a basic idea of how you should go about this. You can also check this post for examples of extending form methods.

  • Verified answer
    Martin Dráb Profile Picture
    237,801 Most Valuable Professional on at

    You have two main options:

    Either use Chain of Command (CoC) to wrap the standard method in your own method. You'll need to create a final class (decorated with ExtensionOf attribute and with name ending with _Extension) and put your code there. For example:

    [ExtensionOf(formStr(CustTable))]
    final class MyCustTable_Extension
    {
        public void init()
        {
            next init(); // this calls the standard implemention
            
            info("It works");
        }
    }

    The other option is using an event handler. Expand the list of events of CustTable form, right-click one of them (such as OnInitialized) and choose "Copy event handler method". Then place this method to a class, (optionally) rename it and put some code into it.

  • KareemTaima Profile Picture
    304 on at

    Thanks all

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 > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 660 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 549 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 307 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans