Fixing Preview Posting: Part 2

  • Post comments:16 Comments
  • Reading time:13 mins read

In my two last posts, I laid out the technical design of the Preview Posting feature, and then showed how to simplify its design to get around the unwanted behavior of TryFunction.

One thing is obvious from these posts: Preview Posting wants to simulate posting of a document (or journal) to show what the results would be, but without leaving any actual trace in the database. In database lingo – we want the transaction to be rolled back.

Rolling back is no brainer. Simply throw an error, or do a silent abort, Except if there is COMMIT. In that case, no rolling back helps.

I have announced earlier that my today’s post will be about how to nest transactions in C/AL so that an inner COMMIT has no effect on the transaction as a whole, which can still be successfully rolled back.

That’s what this post is about.

(more…)

Continue ReadingFixing Preview Posting: Part 2

Fixing Preview Posting: Part 1

  • Post comments:12 Comments
  • Reading time:6 mins read

In my yesterday’s article about the Preview Posting feature in Microsoft Dynamics NAV 2016 I said there are at least two ways to redesign it to avoid both the unnecessary complication and inherent dangers of the TryFunction feature behavior.

In my first post, I’ll show that it would have been perfectly possible to achieve exactly the same functionality without try functions. And it would take a total of one new line of code, one changed line of code, and six removed lines of code.

Let’s go and simplify it.

(more…)

Continue ReadingFixing Preview Posting: Part 1

TryFunction Lessons Learned from Preview Posting

  • Post comments:19 Comments
  • Reading time:11 mins read

One of great new functional features of Microsoft Dynamics NAV 2016 is preview posting. It allows you to preview all the entries that would result from posting a document or a general journal.

Preview posting is not a simple thing. If it was, Microsoft would have delivered it years ago. There must be something in particular with NAV 2016 that powers preview posting, so I decided to investigate it and see exactly how it works.

I am not particularly happy with what I found out, but I have also learned some valuable lessons from it. In this post, I’ll share my findings.

(more…)

Continue ReadingTryFunction Lessons Learned from Preview Posting

What’s New in NAV 2016: Record Type Improvements

  • Post comments:0 Comments
  • Reading time:4 mins read

We all use records. And we all used to whine about records not supporting all the features we need. And they still don’t, but in Microsoft Dynamics NAV they support much more.

Some of the new features are well documented, some are somewhat documented. So here’s what I figured out so far is new about the Record data type.

(more…)

Continue ReadingWhat’s New in NAV 2016: Record Type Improvements

What’s New in NAV 2016: Control Add-ins

  • Post comments:12 Comments
  • Reading time:4 mins read

Well, control add-ins are not new in NAV 2016, they have been around for a long time now. But, they have been improved and this blog post is about these improvements.

Of course, the improvements are exclusively in the Web client framework, not the Windows client, and I am educated-guessing here that we won’t really see many improvements in the control add-in framework for Windows in the future. Why would we? All control add-ins should target all clients and use the Web framework, anyway so the case for Windows client is getting weaker and weaker.

(more…)

Continue ReadingWhat’s New in NAV 2016: Control Add-ins