Creating a Control Add-in using Javascript and calling it in AL. - CloudFronts

Creating a Control Add-in using Javascript and calling it in AL.

Introduction:

In NAV 2017, control add-ins were called through .NET code which is imported as .ZIP files. With NAV 2018 .NET is not supported in extensions. Thus we’ve to perform the following steps to make a Control Add-in in Javascript.

Pre-requisite:

1. NAV-2018
2. VS Code

Procedure:

  1. Create a Startup script as start.js: Startup scripts are loaded whenever the NAV object containing the control add-in starts. Basically, the startup scripts are used for initialization.
  2. Create a Javascript file as demo.js : Contains most of the logic that the control add-in performs.
  3.  Create a control add-in object in AL: Control Add-in objects are used by NAV to register the control add-in and events and procedures on which the control add-in works.
  4. Create a NAV object using AL: This object generally contains the control add-in integrated into the standard, created or customized NAV objects. This object acts as the starting point where events are performed.
  5. Output:
    Added Control Add-In:

    Invoking on INIT:

    Script Invoking on Event:

Conclusion:

Thus, we can create control add-in using Javascript and access in NAV .AL objects using extensions


Share Story :

Secured By miniOrange