Nearly two and a half years ago I had a dream. It was about codeunit references and codeunit interfaces. And today, nearly two and a half years later I am still here, still having the same dream. We still cannot do codeunit interfaces in AL. But it doesn’t mean we don’t need them. We do. We badly do.
Two things triggered me to write this post about how badly we need codeunit interfaces, or any kind of polymorphism: a NAV TechDays talk, and a github project I saw.
Continue reading Codeunit interfaces in AL
Eric Sevareid famously said that the chief cause of problems is solutions. The same applies to the HTML trick I blogged about yesterday. As soon as you solve the problem of using HTML directly in your control add-ins, another problem arises: what do you do with actual images your control add-in includes?
This post explains how to solve that problem, and how to make it possible for your control add-in to both use HTML for defining UI and use relative control add-in paths to images.
Let’s dig in.
Continue reading Extending the HTML trick: using actual images
Where is the problem in the first place, and then what is the solution? Let’s dive in.
I am on a spree today. The number of topics I wanted to blog about has accumulated, and I just decided to dump the stuff over here while I both feel the motivation and have time for blogging. However, in this hurry, I forgot to add some important content to my previous post.
First, I forgot to mention that the example of my preserve-jquery script trick can be found in this github repo:
That’s the demo I blogged about earlier today, except this time it has two more branches:
- Branch “problem”: showcases how a problematic script can break your code.
- Branch “solution”: showcases how this problem can be fixed by applying the trick from my previous post
Also, there are two JSFiddles I created to follow screenshot-base examples from the post:
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