Book Image

Mastering Microsoft Dynamics AX 2012 R3 Programming

By : Simon Buxton, Mat Fergusson
Book Image

Mastering Microsoft Dynamics AX 2012 R3 Programming

By: Simon Buxton, Mat Fergusson

Overview of this book

<p>Due to its interesting capabilities such as finance and supply chain management, business intelligence and reporting, project management, and so on, Microsoft Dynamics is one of the most widely used solutions adopted by many organizations across the globe. This book is a step-by-step tutorial that covers elements from the initial design through to development. Each concept is fully explained and demonstrated by the creation of a real-world project. You will learn some really useful, advanced development techniques such as extending your code with metadata and exception handling.</p> <p>This book is an invaluable tutorial if you are moving from another ERP system or language, or if you are a technical consultant with a desire to create efficient functional designs and business solutions.</p>
Table of Contents (21 chapters)
Mastering Microsoft Dynamics AX 2012 R3 Programming
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Designing a deployment procedure


When building a deployment procedure, there is a point that can cause quite intense discussion. How do we prevent code that is not ready for release from being released?

There is no easy way to shelve code in AX, and many would panic at the thought of synchronizing to the tip. We can create a branch and update the VCS settings with this branch, but we can't easily merge this back into the main branch after release.

The solution we use is to create shelvesets. In order for this to work, there are some dos and don'ts; this is the list that we use:

  • Do not check in every small change. Check in a block of changes that we have unit tested.

  • Plan development work to minimize the overlaps in changes being made to similar areas of the system.

  • Check out the label file when work begins.

  • Once the piece of work is complete and has passed the unit testing, check in the work including the label file. We also tag it with the appropriate TFS task so that the checked-in code is linked to the requirement.

Let's say we have two pieces of work in progress, and one is not ready for release. We can check in the code that is ready and create a shelveset within Visual Studio for the code that should be shelved. We can then synchronize the code with TFS in AX to remove the shelved changes. To check for regression, we would run a full compile and rerun our test cases. The full compile is required as the p-code for a shelved method may still be there, and a call to this shelved method may actually still work! This has caught many out when they say, "It worked in my environment!" only to find that recompiling the affected objects highlights the problem as being a compilation error.

We can bring the shelved changes back into our repository after the release has been done and synchronize AX with TFS.

Once all releasable code is checked in, we create a build that we can then release to the appropriate environment, such as a user acceptance test server.

We may also need to remove the checked-in code; a useful trick is to check out the elements and create a project from the Pending Objects form in order to export it. You can then revert the changes as required, create the release build, and eventually, reimport the XPO after the release is done.

Note

Be careful when importing XPOs. When they are exported, they contain the entire object, even though only one field or method was changed or added. You may need to use the compare tool to merge the changes back in again.