Drag and Drop File Upload for Microsoft Dynamics NAV 2013 R2

  • Reading time:4 mins read

Yesterday evening I spoke at Dutch Dynamics Community event, on invitation by my dear friend Luc van Vugt, and the topic was control add-ins for NAV 2013 R2. Of course, this automatically meant that the audience should see more JavaScript code than C# or C/AL, and that it should be something both fancy and useful.

So how about this: you drag and drop a file onto an NAV page, and the file is automatically uploaded and stored in a BLOB field in the NAV database? And yes, it does the same no matter if you call it from the Windows or the Web client. And yes of course, no external components or dependencies needed.

As I promised, I would make all the source components available for download after the sessions, and if you just want to take the components, here they are, ready to download, install and abuse:https://vjeko.com/wp-content/uploads/2014/03/DragDrop.zip

If you want to know how this thing works and why, read on. Otherwise, just download the thingy, install it (the instructions are included with the file) and abuse it to your fancy.

Continue ReadingDrag and Drop File Upload for Microsoft Dynamics NAV 2013 R2

NAV TechDays 2013 in Antwerp Wrap Up

  • Reading time:3 mins read

Another NAV TechDays is over, and again, needless to say, it was a splendid conference. Thanks to everybody who attended one of my sessions about .NET Interoperability: the pre-conference workshop for beginners, the session for beginners, and the advanced, or as I like to call it, the “Black Belt” session.

As I promised, I’m making all materials available for download here on my blog, and Luc will also make the recordings available from Mibuso.

Continue ReadingNAV TechDays 2013 in Antwerp Wrap Up

Top 10 things I miss in .NET Interoperability in NAV 2013

  • Reading time:14 mins read

If you ask me what the top addition to the NAV technology stack over the past few years is – it’s .NET interoperability. A lot of folks, maybe you as well, would disagree, and say it’s Web services. They are important. But if you are a NAV developer, Web services don’t make your life any easier. You are programming for Web services when your requirements tell you so, but that’s it. You don’t experience those moments of truth, when it dawns on you, when you go eureka, slap your forehead and say: now this is something I solve with Web services! Not quite.

But with .NET interoperability, it’s a different story. If you know how to harness its power, there is no single project you’ll ever want to go without using .NET. It opens the door to the most powerful development framework for Windows, and it makes many impossible things possible, in pure C/AL.

There are two kinds of things in this world. Those that .NET Interoperability can do, and those it can’t. Microsoft has been steadily improving it since the initial release in 2009 R2. However, there is still much to be desired. Those small things that you cut in C# in seconds, and twist your brain inside out for hours before you realize you can’t do it in C/AL. Some of them may be in a backlog somewhere in Vedbæk, but I don’t know that, so I decided to compile a list of top 10 things I believe C/SIDE should support, and it doesn’t.

Continue ReadingTop 10 things I miss in .NET Interoperability in NAV 2013

How Do I… Videos on MSDN

  • Reading time:2 mins read

imageMSDN has started running a series of the How do I… videos for Microsoft Dynamics NAV 2013 (feed here). The idea is to showcase a technical feature in 5-15 minutes. The project is still ongoing, but a number of videos have just been released and announced on the Microsoft Dynamics NAV Team Blog.

The project is a joint effort by Plataan and Microsoft, and I participated as a technical expert in charge of seven videos. I’ve already recorded five of them, out of which three are online.

You can find the links below, and please come back to this page as I’ll update it as more videos are published.

Continue ReadingHow Do I… Videos on MSDN

Cross-Call State Sharing in Web Services

  • Reading time:9 mins read

imageWeb services in NAV have an interesting feature: they are stateless. For a system which is pretty stateful otherwise, this feature can be outright annoying. You must get used to it, and then make sure you never ever write code as if there was any state preserved on the other end.

The reason for this is simple – there is no actual protocol that you use to communicate with NAV through SOAP. Calls are ad-hoc, essentially atomic, each one can accomplish a great deal of things in a single go, and it makes programming a whole lot simpler. The price you pay is the state. Once you close the connection, the session ends and the transaction commits (or rolls back). Next call starts from scratch.

If you need to preserve any state between the calls, whatever that state might be, you are toast. NAV simply doesn’t support it out of the box. A common misconception is that single-instance codeunits help. They don’t. The single instance is always single per session, and since each call is an isolated session, it means that each single instance codeunit dies at the end of the call.

Pretty annoying, isn’t it?

Well, it is, and it isn’t. I won’t argue about validity of situations where you need to preserve state across multiple web services calls – I am going to show you how to do it when you need it.

And what I’m going to show you works in both NAV 2009 R2 and 2013.

Continue ReadingCross-Call State Sharing in Web Services

Web Services Black Belt: consuming NAV web services using pure C/AL

  • Reading time:4 mins read

MP900406779[1]Have you ever needed to connect to the Web services of one NAV instance from another one? If so, I bet that the approach was something like this: you created a .NET class where you defined a Web or Service reference to the target instance, and then you consumed that .NET class using .NET Framework interoperability. It was kind of clumsy, inflexible, but it worked.

How cool would it be if you could do something like this:

WITH WebService DO BEGIN
  CONNECT(‘http://localhost:7047/DynamicsNAV70/WS/CRONUS%20International%20Ltd/Page/Customer’);

  INIT;
  SETVALUE(‘Name’,’Test Customer’);
  SETVALUE(‘Blocked’,Cust.Blocked::Ship);
  SETVALUE(‘Credit_Limit_LCY’,10000);
  CREATE;

  MESSAGE(‘I just created Customer No. %1 in another NAV instance.’,GETVALUE(‘No’));
END;

Continue ReadingWeb Services Black Belt: consuming NAV web services using pure C/AL

Benchmarking Results: NAV 2013 Outperforms All Previous Versions

  • Reading time:17 mins read

imageMarketing is nice as long as it matches the reality. With Microsoft Dynamics NAV 2013, Microsoft has promised a lot of improvements, but how well does NAV 2013 stand the reality test?

Apparently, outstandingly well.

Over the past two days, I have intensively tested NAV 2009 and NAV 2013 through a series of five different tests that measure different aspects of NAV data handling. My conclusion is clear: NAV 2013 is faster than any NAV you have ever seen, including the Classic client on the native database.

Continue reading to find out more about my findings and testing approach.

Continue ReadingBenchmarking Results: NAV 2013 Outperforms All Previous Versions

Top 5 SQL Server Improvements in NAV 2013

  • Reading time:5 mins read

imagePerformance is one of those things you can’t get enough of and NAV is one of those systems where an extra operation per second is always welcome. Yesterday, during the Expert Panel at the NAV day of the Decisions Spring conference, there was a question: is there any improvement in how NAV 2013 works on SQL Server.

And the answer is: oh yeah!

As a matter of fact, everything is new and improved.

Jörg has already posted an overview of the news of NAV on SQL Server in his last blog post, but I still think there’s room for a couple of more words on the really amazing palette of news and improvements.

Continue ReadingTop 5 SQL Server Improvements in NAV 2013

NAV Expert Panel Session Begins

  • Reading time:1 min read

imageI’m right now sitting in the virtual lobby of the NAV Expert Panel Session of the NAV day of the Decisions Spring 2012 conference. The panel features three MVPs, three book authors, and established members of the NAV community: Eric Wauters, Matt Traxinger, Steven Renders, Brent Fisher and myself.

With Microsoft Dynamics NAV 2013 beta out and a lot of partners having laid their hands on it, I assume the discussion will develop around NAV 2013 topics.

I don’t know how much time I’ll have during the session, because I’ll probably be busy answering questions, but I’ll be tweeting live from the session, so if you don’t have an opportunity to join the conference, you can still stay in the loop by following me at @vjekob, or follow the conference hashtag #msdwdecisions.

Continue ReadingNAV Expert Panel Session Begins

Unlimited Text Length in NAV 2013

  • Reading time:1 min read

imageHave you noticed already that in Microsoft Dynamics NAV 2013 the text variables can have unlimited length? That’s quite a leap ahead of the previous versions which couldn’t handle more than 1024 characters per variable. If you wanted to achieve bug-free code then, when you were assigning texts around, you had to concatenate the result down to the MAXSTRLEN of the target text.

Not anymore.

The trick is to simply not declare the Length property on text variables. If you declare a variable of type Text, and then leave the Length empty, it means – unlimited.

Don’t worry – you won’t kill NAV by eating up all the available memory. Underneath C/AL there is .NET now, and strings in .NET are of unlimited length, or better yet – unlimittable – length anyway. Strings will only make things slow if you stuff the revised version of King James’s Bible in them. In all practical situations, there will be absolutely no performance penalty of leaving Texts unlimited.

I don’t know about you, but from tomorrow morning, I won’t be setting Length to my Texts.

Continue ReadingUnlimited Text Length in NAV 2013