Tag Archives: Tips & Tricks

.NET Tips & Tricks: Dispatcher

There are situations when you want to exchange data between different objects in NAV, and there is no simple way to do it. One of those, that a friend stumbled upon a couple of days ago goes like this: you have a page which shows a subpage, that is linked to a factbox. Depending on the situation in the lines, you the factbox shows content from one table or another.

Your instincts may yell “ProviderID” at this moment, but there are some problems with it. ProviderID is used to set the link between different part controls on the same page. But if the link from the provider control results in no record being selected in the target part control, then the OnAfterGetRecord trigger in it does not fire, and you cannot update the content.

Another example may be this: depending on the line selected in the lines part, you may want to show either of two factboxes. Imagine – on a sales order, if you are on a line that sells a resource, you want to show the Resource factbox; and if you are on a line that sells an item, you want to show the Item factbox. You get the gist. There are not many ways you can achieve this.

As a matter of fact, when helping my colleague, I couldn’t think of any.

Except for an old trick which, unfortunately, does not work at all in the RTC. In the good old days of the Classic client, when heroes roamed the Earth, you could pass the CurrForm as a reference onto a function in a subform, which would then store the reference to the main form in its own Form variable. Then, when something happened in the lines, and you wanted to let the master page know, you called the function on the stored reference. It worked like charm. However, in NAV 2013 (and possibly 2009 – can’t bother to check) you cannot assign one page variable to another. Furthermore, the CurrPage variable has page ID in some funny range, and does not even correspond to the actual page number. All in all, no way you can pass, or retain, a reference to a page object, let alone the current page reference.

So, how do you have two, three, or more pages (or page parts, for that matter) talk to each other to pass some information when needed, in all those situations when ProviderID simply doesn’t get the job done (I could bore you to death listing those situations)?

.NET interoperability, what else.

Continue reading .NET Tips & Tricks: Dispatcher

Long time no see, Vienna, Nashville, demo gods, and other things

Oh my. Has it really been *THAT* long? Obviously, yes. Some folks have asked me if I stopped blogging. No, I did not. I just took a way long break from it (which will likely resume the instant I hit the Post button), as I was busy working on other things such as How do I videos for NAV (you can look them up on MSDN and PartnerSource), working on the digital learning for NAV (which is partly available on PartnerSource already, and partly will shortly be), preparing and delivering presentations and some other things.

A month ago, I’ve delivered a session at Directions EMEA 2013 in Vienna where I’ve talked about the .NET ineteroperability and Web services tips & tricks, and presented a series of demos (13 of official ones), and then promised to make them available on my blog. The problem was – I honestly intended to make them available, I just didn’t set a deadline. I work best when I have the deadline, but even then it’s not a granted thing.

This time, in Nashville, I was a bit smarter – I’ve actually set myself a pretty demanding deadline, promising my Directions US 2013 audience to actually post this on my blog this very afternoon. So here I am, sitting at the Paisano’s pizzaria and vino terrace, enjoying the kitschy extravagance of a view of a monstrosity of a place called the Gaylord Opryland Hotel & Resort, and writing this to keep up with my commitment.

Gaylord Opryland Hotel & Resort, Nashville, TN

Continue reading Long time no see, Vienna, Nashville, demo gods, and other things

7 Sure Steps to pass the Sure Step exam

Århus, DenmarkAnother Sure Step course is over, this time in Århus, Denmark. I love and hate teaching this course, because it always makes me wonder why I need this, and why in the Earth I am doing this trainer’s job. And then makes me happy that I do and eager to do it again as soon as possible. It also teaches me something, every time, and here are my lessons learned.

This time, it’s about the exam. At the beginning of the training, I usually ask people about their goals: why are they there, what is the primary objective why they are sitting there and listening to me babble for two days? With Sure Step, the answer is an invariable: to pass the exam.

So people go there because they were sent by their employers to pass the exam, because having professionals certified in Sure Step on team is now a requirement for being a Microsoft Certified Partner for Dynamics.

So, here is my shot at how to prepare for, and pass the exam.

Continue reading 7 Sure Steps to pass the Sure Step exam

Abusing filtering for a lightning fast posting setup

Microsoft Dynamics NAV Classic client has some features which are simply unbeatable when it comes to productivity and speed, one of them being primary-key filtering. When you set a single-value filter on primary key fields in a table, and then insert a new record in the same table, primary key fields are automatically populated with values from the filter.

Yeah, and?

Well, there are so many ways to (ab)use this feature, that sometimes it has a potential to save ridiculous amounts of time. As it just did for me, so I felt an irresistible urge to share it with you. Even though it is so ridiculously simple.

Continue reading Abusing filtering for a lightning fast posting setup

Blank by default

I love unsolvable problems. I simply do. I had one a few days ago in the office, and I solved it.

So, the problem went like this. A discussion has been raised among developers about whether it would be possible to display a blank form over a populated table, where user would be able to immediately enter the data of a new record, without having to press F3 (or inserting a new record manually). The problem is, this doesn’t work that way in Dynamics NAV.

Continue reading Blank by default