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)

Using extensions to add fields to macro

(0) ShareShare
ReportReport
Posted on by 144

Hi, do we have an opportunity to avoid over layering in such case: 

We have a class HrmCompEventRun, for example, and want to add a new field to its macro definition. Do we have any way to do it?

*This post is locked for comments

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

    Regarding class extensions, you can add a new field, but you can't add it to the macro. On the other hand, you could subscribe event handlers to pack() and unpack() and deal with serialization of your field in these handlers.

    If you have control over instantiation of the object, you can simply create a class inheriting from another class, add member variables and override methods. If you can't influence the construction (to provide your subclass instead of the parent class) and you consider a customization, it may be worth to customize only this piece and leaving everything else to inheritance.

    The advantage of class extension is that you can potentially combine several extensions in a single class.

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