NAV TechDays 2018 Demos: Keyboard Shortcut Listener

  • Post comments:1 Comment
  • Reading time:6 mins read

The last of the NAV TechDays 2018 demo series comes with a little story.

While Waldo and I were preparing the “Evolution of the Titan” session, on Sunday before the conference, we were brainstorming the ideas of what would constitute a cool non-visual JavaScript demo. I wanted to showcase the things that JavaScript can do for you in control add-in context, but a less obvious thing. Everyone is expecting to see some cool visual demos, but I wanted to point out the vast possibilities in the non-visual area. Then Waldo asked me: can you make it run an action on a keypress, like post a document on F9?

And that was it! An amazingly cool demo that shows how you can do really cool stuff that falls beyond the visual realm.

Okay, I’ll calm down a bit. Keyboard shortcuts? Seriously? Well, unfortunately, yes. In NAV/BC web client (universal client included) there are almost no keyboard shortcuts. Microsoft is working on some improvements here, but the important thing, allowing developers to bind specific keyboard shortcuts to specific actions, is still conspicuously missing from NAV/BC.

So, I did this demo.

(more…)

Continue ReadingNAV TechDays 2018 Demos: Keyboard Shortcut Listener

NAV TechDays 2018 Demos: User Profile Picture

  • Post comments:5 Comments
  • Reading time:6 mins read

One of the more effective, and probably completely unexpected, demos at Waldo’s and mine NAV TechDays 2018
session was the user profile picture demo. I say “completely unexpected” is that it shows something that you normally don’t expect from control add-ins. When hearing “control add-in”, most developers (but also most Microsoft people) have in mind a visual control that visualizes some data from NAV/BC and possibly allows you to interact with (C/)AL through that piece of UI. However, there are many other things possible, like having a completely non-visual “controls” that tap into the functionality of the web client and extend its functionality beyond what it was originally designed to do.

One of these is the user profile picture.

If you didn’t attend (or watch) the session, this is what the demo is about: it makes use of the user silhouette icon in the upper-right corner (that actually doesn’t represent anything, just sits there) and allows you to take your selfie and then uses that selfie as your profile picture that’s showing there instead. Pretty neat and cool..

How did I do it?

(more…)

Continue ReadingNAV TechDays 2018 Demos: User Profile Picture

Extending the HTML trick: using actual images

  • Post comments:3 Comments
  • Reading time:4 mins read

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.

(more…)

Continue ReadingExtending the HTML trick: using actual images

NAV TechDays 2018 Demos: Customer Star Rating

  • Post comments:12 Comments
  • Reading time:3 mins read

I usually post my NAV TechDays demo stuff for you to use and abuse, and this year won’t be an exception. There are three changes, to previous years, specially the last year. First, you won’t need to wait until New Year’s Eve for me to post my stuff. Second, I’ll blog each of the demos individually, because of the third reason. Third, I don’t want to merely dump my code here with a big fat disclaimer; no – I’ll dump it with a big fat disclaimer and some explanations about what the code does and why.

So, here we go, the first demo (actually the second, because I already posted that Muppet Theme): Customer Star Rating control add-in.

(more…)

Continue ReadingNAV TechDays 2018 Demos: Customer Star Rating

Encapsulation in JavaScript

  • Post comments:4 Comments
  • Reading time:6 mins read

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.

(more…)

Continue ReadingEncapsulation in JavaScript