NAV TechDays 2011, day 2 had just started and Jan and I had run into each other again, joining on our way up to the presentation rooms, executing the time map each of us had probably setup way before we came to Antwerp.
What room are you going to? (Luc) Room 11. (Jan) Vejko's presentation? (Luc, not sure of 'my' room number) No, Bas Graaf - test automation. (Jan)
Apparently I had to enter the other room. Not 11, so room - what was it? - ... 9. I had set my mind on Vjekoslav Babic's presentation on .NET and NAV interop for various peripheral reasons: (*) hadn't so far ever witnessed a presentation by Vjeko, a fellow MVP; (*) thought I knew enough of the NAV testability features; (*) still enough to learn about .NET interoperability; (*) .... All together, as it seemed, no reasons enough to really enter room 9 - sorry for that Vjeko - as I stayed with Jan and found myself fascinated from the start. Bas did a great job in how he presented - ever did a presentation only using your keyboard and keeping the talk going? - and what he presented. I was fascinated from start to finish!
So what was it all about? The conference agenda said:
High-quality test automation for NAV applications
With the release of NAV 2009 SP1 testability features were added to the platform.
These features make it possible to automate most test scenarios. The obvious advantage is that these scenarios can now be executed many times during a project (and beyond) with little to no additional cost. However, just as application code, test code also needs to be maintained. As test suites grow this maintenance may incur considerable effort.
This session will briefly revisit the testability features and will then focus on developing test automation that is maintainable, reusable, easy to understand, and has good performance. The best-practices presented here, were learned at Microsoft during the development of Application features for the 2009 SP1, R2 and upcoming NAV releases
Well, exactly why I had thought that "I knew enough of NAV testability features".
What the conference agenda hadn't told me was that one of the main pillars of Bas' presentation was the usage of Test-Driven Development. But then, would I have decided up front to go for Bas instead of Vjeko? To be honest: nope. Test-Driven Development (TDD) had been some kind of buzz word to me ever since I had heard some - only some - things said about it years ago. A thing that did not fit into my daily program and there was also some weird kind of resistance against this "test and development" matter. All unjust.
Once Bas had finished I could hardly wait to get home and start trying this out myself. I wanted to learn more about it, I wanted my team to start working with it.
Why? First of all as TDD somehow turns the development world upside-down, it turned me upside-down. In such cases I want to get hold of it; be in control of it. But next to that - and more important - TDD seemed to me a efficient way of getting the NAV testability features incorporated in our development practices and, as such, getting automated tests in place. Something we are more and more in need of.
Even though I went home with this TDD flame burning inside every-day-reality did not allow me to light the fire straight away. No dismay as I knew this flame was substantial enough to stay there: I was going to dive into this one of these days. And indeed they came, "these days". Not one but more, each being a step on the ladder I needed:
The fire is burning and I will keep it going in some sequential posts. Stay tuned.
Jan (Zen & the Art of C/SIDE Development): thanx for being in your slip stream.
For one time analysis of data in NAV I always take the quick and easy route of copying data from NAV to Excel using the windows clipboard. Running the relevant table(s) from Object Designer, copy (preferably) all records and paste the whole bulk into an Excel sheet. It can take some time depending on the number of records in the table, but once copied into Excel I can filter and aggregate whatever and however I want to. And no need to write any code in NAV.
Recently I did encounter an issue I had never come across in all these years. Once the data were copied to Excel it looked like this:
Note that I have setup this example for this blog as the real data were more complex and of course somehow business sensitive, but for sure making more sense. Nevertheless the example above is plainly displaying the issue, i.e. Description fields containing control (and non-printable) characters like TAB (hexadecimal 09), LF (hexadecimal 0A) and CR (hexadecimal 0D), inserted directly after the word description (and before the opening parenthesis), and when copied to Excel these control characters seem to mess up the orderliness in my records as TAB, CR and LF are interpreted as columns delimiters!
Ouch, this wasn't fun as, in my real data, I had many records contaminated with these characters. As it was a one-time-only thing I decided to clean up my data manually. At the same I was wondering what the source of this contamination was and why NAV was not able to copy the data to the clipboard right, i.e. handle field values as coherent blocks of data. I learned that the real data was (partly) imported from WORD files thus accounting for the presence of the control characters.
BTW: this is how my data looked like in NAV:
To get the data into this Test Clipboard table I had created a .csv file with the 6 records inserting TAB, CR and LF (and CR/LF) at the relevant spot and imported the data using a straight forward dataport (no code, no customized properties,1 dataitem and three dataport fields).
Yes and No.
Yes, I was just surprised and I would have expected the data to show right in Excel.
No, of course the clipboard isn't a major NAV feature and for exchanging data between NAV and other applications like Excel we have other possibilities (even though you might want to have a look at the To Increase clipboard feature).
Fiddling around with my clipboard test in NAV classic just to investigate and understand what I had come across, some interesting anomaly showed up when copying data from classic form clipboard or a RTC page to the windows. Have a look:
Do you see the difference? (If not, compare row 3 in both screen shots.)
Funny that CC is straight forward apparently not taking into account control characters in text fields, but RTC seems to deal differently between TAB on one hand and CR and LF on the other.
Of course this is what I expected:
Yes and No. Still, did report it to MS. You might want to give your vote to it here.
Christmas Eve and I am late, probably too late to effectively wish you all a merry Xmas. I guess, contrary to last year, the climatological circumstances did not bring me in the mood to write you all, way before this instance. Have a look how today showed itself to us over here in Warnsveld, Netherlands. Blue sky, sun lit and a moderate temperature. Not really what we, in Western Europe, imagine Xmas to be.
Nevertheless, two weeks off, two weeks to get some administration done, write some blog posts, go out skiing in the French Alps (hope the snow will show itself out there), and of course play Ticket-to-Ride (you might recall this one), but Sinterklaas did bring us a new challenge: Smallworld. Indeed a challenge to get the manual read, I thought it was only for software people could write complex manuals for easy tasks. The game, however, is promising.
So ... merry Xmas, "... wherever you are, whatever you believe, whomever you love. Merry and bright. .."
BTW: one reading tip: The Reader by Bernhard Schlink
With the last event on November 23, 2011, I dare to say that the Dutch Dynamics Community (DDC) has made well enough a name to carry it using its own resources (see below). As such I most probably will no longer be using my blog as a means of communication for the DDC. So for those that have been relying on my blog for being informed on DDC matters, please change your ways of doing and start using the DDC owned resources.
So what resources does the DDC have?
Not yet a member of our LinkedIn? Go there and enlist yourself!
Not receiving our Nieuwsflits? Send a mail to firstname.lastname@example.org!