Extending Microsoft Dynamics 365 Finance and Supply Chain Management Cookbook - Second Edition
by Simon Buxton
How it works...
Any workflow approval is set up with outcomes, which are referenced by an event handler class that implements an interface for each outcome it handles. Each outcome is tied, internally, to that interface. When the outcome occurs, it will construct the referenced event handler class using the interface as the type. Then, it calls the appropriate method. This pattern (instantiating a class using the interface as the type) is a common pattern. We used this ourselves in Chapter 6, Writing for Extensibility, in the Defining business actions in data recipe.
There are some events (Started and Canceled, for example) that are set on the work approval's main property sheet. All this was created for us when we created the workflow approval ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access