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 :
Microsoft Dynamics AX (Archived)

How I will call or add new method or events in Standard objects in D365FO

(0) ShareShare
ReportReport
Posted on by 30

Dear All,

Can you please let me know

A). I will add METHODS

1. New method in Standard Table.

2. New method in Standard Form 

3. New method in Standard Form DS

4. New method in Standard Form Control.

B). How I will call EVENTS in Standard(Table, Form, Form DS, Form Control) ? 

Example

Form > SalesTable > Event > OnActivated

Form > DS > SalesTable > OnCreated

Form Control > SalesTable_SalesTypeGrid > Event > OnValidating

Table > LedgerJournalTable > Event > OnDeleting

How I will call the above events from Standard Objects ?

Please give me more shed on this.

Thanks!

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Martin Dráb Profile Picture
    237,801 Most Valuable Professional on at

    A) Use class extensions, as we discussed with you several times. Here is the documentation, please read it: Class extension model in X++. Note that which form elements are supported depends on which platform version you use.

    B) These events are triggered by AX kernel, not by custom code. But if you, say, delete a record from code, the OnDeleting event will be raised by kernel.

  • Suggested answer
    Rustem Galiamov Profile Picture
    8,072 on at

    Just to add to Martin suggestion, check this link https://docs.microsoft.com/en-us/dynamics365/unified-operations/dev-itpro/extensibility/customize-model-elements-extensions

  • @rp@n Profile Picture
    30 on at

    Thanks All,

    I go through the above link. I have one doubt.

    When exactly we use "ExtensionOf()…" in Class extension ? 

    Please give me more shed on this.

    Thanks!

  • Suggested answer
    Rustem Galiamov Profile Picture
    8,072 on at

    Extension classes are classes that are adorned with the ExtensionOf attribute. The class augments the artifact that is specified in the ExtensionOf attribute.

  • @rp@n Profile Picture
    30 on at

    Thanks Rustem,

    That I understand but my question is when I need actually this Extension class with ExtensionOf attribute to write code ?

    Is there any specific reason?

    Thanks!

  • Suggested answer
    Rustem Galiamov Profile Picture
    8,072 on at

    Always when create an extension.

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

    When you want to "add" a method (which is the topic of this thread), add state or use CoC. Again, it's all covered in documentation.

  • @rp@n Profile Picture
    30 on at

    Thanks Martin,

    You mean to say find(), display() Or any new method correct?

    Please give me more shed on this.

    Thanks!

  • Suggested answer
    nmaenpaa Profile Picture
    101,160 Moderator on at

    Please read the documentation and try for yourself. With these two methods you will learn so much more about these D365FO development fundamentals.

    If you can't find answer in the documentation and your code has issues, then ask from others.

    I'm saying this because you seem to be asking so many questions about things that you could find in one minute from the documentation or by experimenting.

  • @rp@n Profile Picture
    30 on at

    Thanks Nikoloas,

    Sure,I will go through the documents or link.

    I am asking because in my mind some questions are raising. I am new to D365FO

    Any way, Thanks!

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
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans