Learning Dynamics NAV Patterns | The book has shipped!

Today I was a happy man when I got home. I unboxed the first 25 copies of my new book Learning Dynamics NAV Patterns. Just in time for Directions EMEA next week.

WP_20150930_006

I will take 25 copies with me next week. If you would like a copy, find me at the event, between the 1000+ other people. You can easily find me. I am the tall guy with the ponytail wearing a NAV Skills t-shirt.

WP_20150930_005

I hope and expect the book to have a positive impact on the way the NAV partners develop software. I believe it is time to take the next step in proffesional software. This book explains how and which elements of Dynamics NAV are good to be reused.

Looking forward to see you next week!

(Did I say I am happy?)

PS: You can order the book here

Or on Amazon:

Directions EMEA 2015 | T minus One Week!

Honestly I cannot believe how time flies. Maybe its age, but I feel like years are passing by so fast.

Funny enough I am writing this blog about Directions EMEA from Poznan. After one year since we had the event here in Poland I am back to teach a Architecture and Patterns Master Class for IT.Integro and  their partners. I managed to schedule this in a week when the airport was closed. Very smart.

So a year has passed by. A year where a lot has happened. We got NAV 2015 with a lot of cool new features and Microsoft started working on NAV2016 with even more cool new features. This will be presented and released in Mannheim. One week from now.

My Session This Year

Funny enough my sessions seems to be about something “old”. Web Services. However, I think it is still something new. And it is maturing.

I like to talk about things that have been around for a while and what the best practices are. Just like with my workshop and the Design Patterns. Once something has been around for a while we learn the pros and cons and how to tackle the unconvenient things.

This is also the status with Web Services. Being around for a little over a decade and somewhat shorter for Dynamics NAV we have learned a lot. Both in the Dynamics NAV ecosystem as well as globally.

Webservices are moving from SOAP to REST and REST is being simplified to OData. What does that mean for NAV partners? What is Json and how does it compare to XML? How do I consume a webservice? Should I compile a DLL? Should I use HTTP with DotNet? What are the best practices? Should I expose a page? Or an XML port? Wait, what about a Query? Which is OData.

So many questions.

Honestly? When we were giving Gary input for the MVP track during a PRS meeting I wanted this session to be taken by someone else. Yes I am curious to these questions, in fact this session idea came from me. This is something I want smart guys like Vjeko, Arend-Jan, Gunnar or Waldo to answer.

But this is not what happens. I am in a hotel room in Poznan preparing for this.

BUT

I am not alone. These smart guys will be in my panel. They are in the session to answer YOUR questions. I will talk about everything I mentioned in this post. What is the status of Web Services in 2015. What do we get from Microsoft to consume webservices?

Gunnar will also demonstrate how to use a REST webservice with a Json resultst.

Don’t stay away

Lets see how we can fit 1200 people in my session. I know you are as curious as me.

See you next week in Mannheim. By then I will have another 1300 KM on my meter I guess.

Tip #53 – Locks, Blocks, Deadlocks and Timeouts | What are they

Recently I’ve been asked to do a code review of a vertical solution. Since these are always interesting projects I cleared my schedule and planned an interview to see what it was about. I’m curious by nature.

During the interview I was told that some of their customers were complaining about deadlocks. This was going on for a while now and they did their best to look at the problem and even created a chart with deadlocks per day.

This was honestly not that much so I figured something else must be wrong. After the intake we spent some time looking at one customers system and I started up some measurements in SQL Server Profiler. Nothing fancy, just some lock events.

2015-09-15_08-06-54

This showed that not deadlocks, but locktimeouts are causing the problem. From a user perspective they almost look the same.

Here is the deadlock message:

deadlock

And the locked message:

Lock

But the source of the problem can be entirely different.

Simulate a (b)lock timeout

This is realatively easy. Simply create one codeunit that reads a customer record and hold the transaction with a confirm. (Never do this in real life kids)

Lock Code

Now simply run this codeunit twice and the timeout message will appear.

Simulate a deadlock

This is a little harder. We need two codeunits this time.

deadlock code

In this scenario we read two different customer records with a confirm in between.

Start both codeunits and then quickly press the confirm message. If you do this within the locktimeout window (default 10 seconds) you will get a deadlock.

Locktable

This last example also proves the myth about locktable busted. This is probably the most ambiguous command in C/AL language. It does not what it implies. It does NOT lock the table, but only locks the specific rows you read in the database.

Microsoft, can you please rename this to something that makes more sense?

Tools

You can also measure blocks and deadlocks using the tools Jorg Stryk provides for free. http://dynamicsuser.net/blogs/stryk/archive/2014/10/10/directions-emea-2014-troubleshooting-nav-2013-r2.aspx

Tip #52 – Run MODAL pages after INSERT

One of the things I spend a lot of time on during my workshop is design for performance and using temporary tables. There are so many great things you can do here.

Let’s look at this code:

Buffer 1

Typically after an insert you would expect this error when trying a RUNMODAL

Buffer 2

But, not in this case. Here we have this:

Buffer 3

The reason why this works is the use of a temporary table. The record is not actually inserted into the SQL Server database.

Buffer 4

This is very useful for example when running a wizard. This allows you to roll back the transaction very easily when the wizard was cancelled.

Do you want to lean more?

During my workshop I spend a lot of time on these typical things in NAV that are poorly documented but very powerful.

The next workshop is in Copenhagen, close to the heart of NAV developement.

Register here. (QBS Partners can use vouchers)

Microsoft How Do I Video Series | Behind the scenes

Microsoft produces How Do I videos for many of their products. They can be found on MSDN where they are grouped by product.

https://technet.microsoft.com/en-us/cc138021.aspx

For Microsoft Dynamcis NAV we have recorded over 100 videos for NAV2013, NAV2013R2 and NAV2015. The recordings for NAV2016 are being prepared as I write this blog.

I came on board for NAV2013R2 to do a series about NAV Development Best Practices that we then decided to call Design Patterns. I also did a handful of other videos about the Job Queue, Word Reporting and lately some functional end user scenario videos.

Let’s take a look behind the scenes and see how these videos are being made.

Scenario & PowerPoint

The videos are created using a scenario. This is often the title of the video with a small description of the steps. After beign approved by Microsoft the recording can start.

Most of the videos are recorded at home or office. We use Camtasia which makes it relatively easy to record them. Lately the editing such as zoom and highlight is done by an editor which saves a lot of time, before that this had to be done by the author.

The PowerPoint has evolved to a nice moving introduction to the video. Most of the How Do I video should take place in the product itself, not in powerpoint.

The Recording Studio

Some videos are recorded in the studio. The one we use in Europe is in Belgium. The same studio as used for Plataan TV which most of you know from other online training.

WP_20150831_003

The studio is at the research campus in Hasselt.

WP_20150831_004

The first time you are in a studio like this it is a strange experience. No matter how many videos you have recorded at home, this is different. But once you are used to the cameras it is fun and when well prepared we can be very productive in the studio.

Do you want to join the team? Leave a message on the blog and I will forward it to the team.