You are on page 1of 10

ULTIMATE GUIDE TO

EXTENSIBILITY IN
DYNAMICS 365
WHAT IS EXTENSIBILITY?
In Dynamics 365, extensibility
lets you customize the
software to fit your business
needs. You can add new fields,
change how things look, or
even create new functions to
make it work just the way you
want.
LETS
CODE!
TABLE EXTENSION
Navigate to the AOT (Application Object Tree)
Select any table from the AOT. Lets say: CustTable
Right click on it & select Create Extension.
This creates an extension in your current opened solution.
Creating extensions for
All other elements is done
by the same approach
except classes
CREATING A CLASS EXTENSION
Create a new empty class & name is as follows:
Prefix + ClassName + _Extension

So for example if I am creating an extension of class


PurchAgreementEventHandler then the name for its
extension class would be:
DNPurchAgreementEventHandler_Extension
CLASS EXTENSION STRUCTURE
The ExtensionOf attribute defines what this
class would be the extension of with the name
of the default class being explicitly mentioned.

The name ensures that proper


final keyword ensures that naming convention is being
this class cannot be followed and that extensions are
extended by any other class. easily identifiable.
CREATE A METHOD WRAPPER
A method wrapper is our custom method that will be wrapping
around the original method of our default class.

The method wrapper is nothing fancy. A simple method with the same
signature as the default class method.
Signature = Access modifier + return type + Name + Parameters
CHAIN OF COMMAND (CoC)
The next keyword is used to invoke a chain of command call. In
order for the wrapper to be effective, a call to next is
mandatory.

Call to next keyword for Running custom logic based on


position of written code
the CoC to be invoked.
before/after next call.
Hi there, I'm Taha

Follow me for more daily posts.

You might also like