Saturday, May 27, 2017

First book about Dynamics 365 for Operations development is out

From the publishers homepage:

"Dynamics 365 for Operations is the ERP element of Microsoft’s new Dynamics 365 Enterprise Edition. Operations delivers the infrastructure to allow businesses to achieve growth and make better decisions using scalable and contemporary ERP system tools.

This book provides a collection of “recipes” to instruct you on how to create—and extend—a real-world solution using Operations. All key aspects of the new release are covered, and insights into the development language, structure, and tools are discussed in detail.

New concepts and patterns that are pivotal to elegant solution designs are introduced and explained, and readers will learn how to extend various aspects of the system to enhance both the usability and capabilities of Operations. Together, this gives the reader important context regarding the new concepts and the confidence to reuse in their own solution designs.

This “cookbook” provides the ingredients and methods needed to maximize the efficiency of your business management using the latest in ERP software—Dynamics 365 for Operations."

Buy it from the publisher or from Amazon.

Friday, May 19, 2017

Use tags to find related bits and pieces in your code base

A lot of elements, if not all, in Dynamics 365 for Operations (D365FO) has a property called "Tags".

With this property you can link all sorts of different otherwise unrelated elements. You could for example use this as part of a bigger change you need to do to your code base, marking all the bits you need to modify.

Adding a tag is as simple as just using it:

For Visual Studio to find places where the tag is used, you need to do a  build with the "Build cross reference data" option checked:

And here is where you search for tags:

And here is the result:

This ought to work for code to. The editor knows about the tags and has intellisense for them:

But the "Find tag references" tool doesn't pick them up. I wonder if that is a bug or not.

And in my opinion you should try to not go overboard tagging away all day long.

Monday, May 15, 2017

FormRun.wait, Box and ChangeCompany - a poor cocktail

I have had some code like this (simplified for the purpose of the example):
    formRun = new FormRun(...);

If you run this code and manually change company while the form is open and "waiting", the call to Box will make the system freeze up. I have reported this as a bug, but it is not accepted to be fixed.

The workaround, or you could argue proper solution, is to add an event handler for formRun.lifecycleHelper().StageChanging and run the Box code when the stage of the form changes to "Closing". That way Box is called before the form is entirely closed and the company account is changed, and then Box runs all right.