Extending Microsoft Dynamics 365 Finance and Supply Chain Management Cookbook - Second Edition
by Simon Buxton
How it works...
We have written a generic way to create purchase orders from a list that we can use in many places.
This is the first time we have used a Map object. Maps are key/value sets where the key is guaranteed to be unique. We can iterate over them using the map's getEnumerator() method, which returns a MapEnumerator object.
We also used var for the first time. This behaves the same as the C# var. This can be any type and must be assigned to be an instance of a type when it is declared. It is very useful when we don't know the type at design time.
These are very useful, and sometimes risky unless used correctly. For example, we must always check whether an element exists before using the lookup method, otherwise it throws an exception. ...
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