Errata and Updates to my book and GitHub project (2nd edition)

Like any other kind of project writing and publishing a book never leads to a 100% flawless result, whatever the level of commitment and professionalism. My peers and I have spent so much time in getting things reviewed and modified. Alas, it might seem useless but of course isn’t. I am grateful we did catch various things and could get them improved. Not just typos or grammatical errors. Also necessary clarifications and additional information.

Starting to read the book myself as a source to my work I already have stumbled over a number of incongruities which I marked in my copy. Now it’s time to share to most relevant ones with you to enable you to get tour doubts addressed. Where I will not be able to update your copy of the book I will make sure that any anomaly in the code or any of the documents shared on the GitHub repo will be updated.

As promised on the same post for the 1st edition I will be updating this topic, so, keep an eye on it, if you want to be updated too.

Errata

Chapter 2

Figure 2.1 – The red-green-refactor mantra (page 20 in e-book)

A small update was needed in the flowchart displayed in Figure 2.1. Note the difference in the following two images, where the first one displays the original version and the second the fixed, newer one.

Figure 2.1 original
Figure 2.1 fixed

The Visio file on GitHub has been updated accordingly.

Chapter 7

Test Example 6 – how to hand over data to UI handlers (pages 172 and 173 in e-book) – 20220216

This example discusses a test scenario that is part of the following feature:

[FEATURE] LookupValue Inheritance

The test code section on pages 172 and 173, however, mentions a wrong feature:

codeunit 81001 "LookupValue UT Sales Document"
{
  Subtype = Test;
  trigger OnRun()
  begin
    //[FEATURE] LookupValue Sales Document / Customer
  end;

This should be:

{
  Subtype = Test;
  trigger OnRun()
  begin
    //[FEATURE] LookupValue Inheritance
  end;

Chapter 11

End-to-end code execution path (page 282 in e-book) – 20220208

In the note, regarding cyclomatic complexity, I reference “a nice extension called AL Lint by Stefan Maron”. This specific extension has been deprecated and replaced by a new extension called BusinessCentral.LinterCop. The VS Code extension can be downloaded from BusinessCentral.LinterCop – Visual Studio Marketplace. Note that it is not (just) this extension that does the job, but it manages a .dll that will do the trick.

Deconstructing your scenario – steps 1, 2, 3, and 4 (page 284 in e-book)

In the note a very unfortunate typo happened here: the words now a should have been no.

Creating, maintaining, and executing a consecutive sequence of dependent tests has
a couple of challenges as there is no formal way to link them together and enforce
their execution to be always a complete run of these tests.

Appendix

Getting standard test and test library apps deployed (page 361 in e-book) – 20220818

In this section I discuss what standard test and test library apps should get deployed when having installed Business Central from a product DVD. To make this deployment much easier for you I also point out to a script on Github that can do this in one go. There is however one thing I overlooked at that time: the System Test Library app references a .NET component that is not by default installed in the service tier (Add-ins) folder. This component is called MockTest.dll and is to be found on the product DVD under Test Assemblies\Mock Assemblies. When you run my script is will fail when deploying Microsoft_System Application Test Library.app with error:

Publish-NAVApp : Extension compilation failed
DotNet%20Aliases/src/dotnet.al(8,14): error AL0451: An assembly named 'MockTest, PublicKeyToken=null' could not be found in the assembly probing paths 'C:\Program Files\Microsoft Dynamics 36
5 Business Central\200\Service\Add-Ins, C:\Windows\ServiceProfiles\NetworkService\AppData\Local\Temp\Microsoft Dynamics NAV\Add-Ins\20.0.39668.39849, C:\Program Files\Microsoft Dynamics 365 
Business Central\200\Service\, C:\Windows\Microsoft.NET\assembly\'

We need to assure MockTest.dll gets copied to the Add-ins folder and the service tier restarted. To achieve this I have updated the script on Github.

Thanx to …

… Carolien Kaasenbrood of Adfocom for reporting the issue.

Updates

Note that based on out-scoped issues I am also adding updates to the GitHub repo. Each of them is discussed in a separate post. Have a look here:

Note

If you have any question and errata/updates to report feel free to do so below, and even though I am not listing any grammatical omission above you’re welcome to provide them too

4 Comments

  1. Chapter 11 fix, should you remove the ‘a’ also??

    …as there is no formal way…

  2. Hi Luc
    The link from Packt for the hard copy book takes to you the first edition in Amazon. Unless you pay attention on the page, people may miss the link for the new edition. Can it be updated?

Leave a Reply

Your email address will not be published. Required fields are marked *