NAV 2016 and TryFunctions: epic fail?

When I was at Directions EMEA some weeks ago and for the first time I saw a brief explanation on how the new NAV 2016 TryFunctions works, I was a bit surprised: if an error occours inside a TryFunction function, the transaction is not rolled back!!! What a monster!!

My first think: “this cannot be true, there’s a rule that says that transactions must always be consistent. I’m sure I’ll not well understood all… I’ve to read more about them!“.

But now?

Unfortunately, all was true! 😦 this post has cleared my mind definitively.

Microsoft itself inside NAV 2016 uses a trick to prevent transaction inconsistency due to a TryFunction errors by using the new C/AL function CONSISTENT:

In summary, the record is marked as inconsistent as default, and it becomes consistent ONLY if the TryFunction works without errors. For me this is so bad…

I’m sorry to say that but I think that actually the new TryFunctions can be used only to handle errors when you don’t have to work with records (for example when you work with .NET variables or others). Never use them when you have to work with records!!

Transaction consistency is a must and the actual TryFunction implementation is for me incomplete or at least is a great door opened for errors… Not good!

Hey NAV Team, why not review the implementation on a future NAV 2016R2?

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.