Tag Archives: Control Add-in

Encapsulation in JavaScript

This will be my last post in the “JavaScript for (C/)AL Developers” series today. If I continued blogging about nearly pure JavaScript stuff, you could reasonably ask if this is in fact an NAV blog or a JavaScript one. It’s still NAV, and while the stuff I am about to write about is purely a JavaScript concept, I find it highly relevant for any control add-in developer. So, hold my beer, and bear with me for another one.

One of the complaints I often hear about JavaScript is that in JavaScript there is no encapsulation. This is almost completely true, except for the fact that it’s entirely false.

Where is the problem in the first place, and then what is the solution? Let’s dive in.

Continue reading Encapsulation in JavaScript

Preventing trampling over $

In my previous post, I’ve written about the situation when you (or somebody you trust) redeclares the $ variable, thus inadvertently breaking all your jQuery code. I’ve also explained how to remedy for it inside the code you write by applying the Immediately Invoked Function Expression (IIFE) or Self-Executing Anonymous Function pattern.

However, is there anything you can do to prevent anyone from trampling over $ or jQuery variables in the first place?

As I said in my last post, yes, and no.

Let’s take a closer look at it.

Continue reading Preventing trampling over $

Abusing Images property to load HTML in control add-ins

One of major limitations of control add-ins is not being able to define HTML. It seems so unbelievably unbelievable, that anyone looking at it from the outside of the NAV/BC playground may say “obviously, you must be missing something!”. But I am not. The one thing that you would expect to find first when defining a control add-in (and control add-ins in NAV/BC are nothing more than pieces of HTML that live within the allocated area of your browser real estate) is to be able to define the HTML. And yet, you can’t define it. The only way to show any UI from your control add-in is to procedurally create any of your control add-in HTML.

This makes no sense. No. Sense.

Continue reading Abusing Images property to load HTML in control add-ins

Control Add-in Dependency Demos

Yes, I keep forgetting about “stuff”. First I forget about blogging in general, then I forget how to blog properly. I’ll get it sorted out. Eventually. Solemnly swear. Kind of.

Anyway, my demos yesterday were full of screenshots. Useful stuff. You can copy a screenshot from there, paste it to OneNote 2016, then get the text from picture. Amazing stuff.

But, that’s not how code is done these days. So, I put everything on GitHub, and if you want to access all of the code you watched me build yesterday, here it goes:


Good luck!

Accessing a control add-in in a dependency extension

Long time no see, eh? Time flies, what do you know…

I am thrilled to still find you here. Honestly, I wasn’t sure this morning if I was about to even find this blog where I left it seven months ago. Cool to find both my blog and you in good shape, patiently waiting for my contribution.

This morning I had a call with a partner asking if it was possible to deploy a control add-in in such a way that other partners could use its functionality from their own extensions. My answer was, and it still is – well, it should be possible, but I don’t know for a fact because I never tried it.

So let’s try it and find the answer together.

Continue reading Accessing a control add-in in a dependency extension