Getting attributes in X++

In X++, you can decorate classes and methods with attributes. Attributes were added in AX 2012 (I believe), where the typical use case was a definition of data contracts. They’re much more common in F&O, because they’re also used for CoC and event handlers. For most developers, attributes are something defined by Microsoft and used …

Continue reading ‘Getting attributes in X++’ »

Event handler for multiple events

I’m not sure that everybody is aware that a single event handler method (in Dynamics 365 for Finance and Operations) can be decorated with several event handler attributes. For example, a common method can handle both inserts and updates. [ DataEventHandler(tableStr(MyTable), DataEventType::Inserted), DataEventHandler(tableStr(MyTable), DataEventType::Updated) ] public static void myHandler(Common _sender, DataEventArgs _e) Or it can …

Continue reading ‘Event handler for multiple events’ »