A collection of X++ gists for those occasions when the help pages don’t cut to the chase!
It is important to following the naming guidelines when extending an existing object to ensure uniqueness across the Application Object Tree over time.
Additional methods are added to an existing table by creating a new class with an attribute declaring that it extends the existing table:
Additional behaviours are added to existing class methods by creating a new class with an attribute declaring that it extends the existing class:
Use multicast delegates to create extension points for other developers to subscribe to.
Remember that the order in which the handlers receive the invocation isn’t predictable.
Take care not to add event handlers to a class that is already extending a table as the compiler will incorrectly add these methods to the Common object.
Subscribing to a multicast delegate:
Handling a form event:
Form data-source events
Handling a form data-source event:
Form control events
Handling a form control event:
Handling a table event:
Regardless of the language, you should only ever reference an enum by its elements (and not it’s intrinsic value). Historically, X++ developers have sometimes referred to the enumeration’s intrinsic values. This is no longer supported in D365FO as these values are determined at runtime.
Using enums in a switch
We can also use the elements from an enum in a switch statement:
Working with XML
Iterating a list of XML nodes
More gists to follow…