Delegate in D365

Hello Everyone,

Can anyone explain me why we need Delegate in D365? And how we can add new Delegate in standard class (i.e. exits in Appication Suite package ).

Please remember i am working on application version 8.0 & The Application Suite package was locked in application version 8.0.

You can’t physically add anything to standard classes in 8.0+: no methods, no delegates, no member fields… You can only use extensions. If the class isn’t as extensible as you need and a new delegate would solve it, log an extensibility request on LCS.

Think about delegates as events (in fact, I think it should be the correct name). If a class exposes such an event (such as JournalPosted), you can ask it to let your code know when this event occurs. In other words, you register a method (event handler) of your own class, which will be called when a journal gets posted.

The result is nicely decoupled code. The standard code knows nothing about the handlers, all it does is exposing an event and triggering at the right time.

For reference, this topic is now being discussed in the duplicate thread in Dynamics Community forum.