Story

Did you ever thought how much time developer spend on selecting the right image to NAV action?  In NAV 2017 there were 1049 images, and in NAV2018 we have 1104!

 

So every time developer add new action, he should select one image from 1104. It could take 5-10 minutes. For some period of time Dynamics NAV Image Library by AJ Kaufmann was a solution for me. Thanks for him once again!  And what about the quality of this choice? NAV developers are rarely good in UI design. This could result in good solution with ugly interface.

 

Idea

On the other hand, we have awesome standard NAV with huge number of high quality standard actions, which were designed by Microsoft.

So all this pushed me to an idea: What if we can take standard NAV, create machine learning model, which will propose image for custom action, and add this possibility to Visual Studio Code as an Extension to AL?

 

Sounds good!

 

To solve this simple task (at first sight), we need to:

1)    Create training dataset for machine learning

2)    Create machine learning model and train it

3)    Publish model as a web service

4)    Create Azure Function with some code to call ML web service (why AF? See in later blogs)

5)    Create Visual Studio Code Extension

6)    Create marketing materials and publish on Marketplace

 

Practically all of this is - out of my comfort zone. But I decided to start the journey. And with the help of different blogs, YouTube videos, and “googling” we have happy end :)

Solution

With honour, I share with you iAL extension for Visual Studio Code! 

 

It’s very easy to use it.

  • Install iAL extension on your Visual Studio Code from Marketplace
  • Create page or page extension in Visual Studio Code
  • Create Action on your page (using tAction snippet for example)
  • Add Image property
  • Press Cmd+Shift+P on OSX or Ctrl+Shift+P on Windows
  • Select iAL: Get image for action
  • Type the purpose of your action (name or short description)
  • Feel the magic!

Now there is 1.15 sec pause between call and answer. That is because my Azure ML model has 90,249 % prediction rate, which is very good, but model is complex. May be in another version I will reduce this time.

But agree that 1 second is nothing in compare to manual work!

In later blogs, I will share more detailed information about how I’ve passed every step. But now feel free to use iAL extension in your everyday work (I hope you use AL every day?).

And please, rate it and leave feedback on Marketplace and create issues on ial github project

How this works

1. Architecture and Azure Functions

2. Azure Machine Learning

3. VS Code Extension

 

P.S. Thanks  to Mark Brummel, waldo, Tobias Fenser, vjeko for their git hub projects, posts, and YouTube videos.  That helped a lot!