Dynamics 365 Business Central : New modern development environment

This walkthrough, covers the steps of setting up the environment to write extensions for Dynamics 365 Business Central
Dynamics 365 Business Central and Visual Studio Code must be install in your local machine.
  1. Open Visual Studio Code and bring up the extensions view by clicking on the extensions icon or tape the Extensions command (Ctrl+Shitf+X)
    11tffjvjlq4h.png
  2. Install AL Language Extension
    • Install AL Language Extensions from Marketplace
      Search for AL language Extensions and click Install button.
      0ssiw1kekm4t.png
      After a successful install, you will see a Reload button. Clicking on this will restart VS Code to enable the extension.
    • Install AL Language Extensions from Dynamics 365 Business Central Setup Folder
      Click on the <Three point button action> and click on “Install From VSIX…”
      113c89kkozaq.png
      Navigate to the file ALLanguage.vsix, and click Install
      m2v1smtrub3s.png
      Path of the file: Dynamics365BusinessCentral\ModernDev\program files\Microsoft Dynamics NAV\130\AL Development Environment
  3. Configure Dynamics 365 Business Central Instance
    Open Business Central Administration and ensure that “Enable Developer Service EndPoint” and “Enable loading application symbol references at server startup” are active then restart Service.
    r3pu924ok36m.png
  4. Create your first application
    Open Visual Studio Code and then press: Ctrl+p and choose AL:Go!
    ksp3ipkkip7f.png
    You can also press: Alt+a then Alt+L
    vfe8fxycqdol.png
    Choose the project directory, then choose the sandbox Read more
    In our case, we will select (Your own server)
    8c36ghs07q0t.png
    Then we have to setup the configuration of our application to connect with the server.
    wyfvebdythlo.png
  5. Configure application
    In an AL project there are two json files. When we start a new project, these files are generated automatically.Read More
    g7vz836ry6ze.png
    Let’s discuss some important and mandatory properties:
    dp4farqeu9ii.png
    On launch.json file, modify the properties of "serverInstance" and "Authentication"
    ychc42grh7z5.png
    • ServerInstance : Your server instance name (DynamicsNAV130 for our case)
    • Authentication : Your server authentication method (Windows for our case)
    Once launch.json and app.json are modified, press Ctrl+p and choose “AL:Download symbols
    62iz1zd4s5uz.png
    After download complete, you should see two new files added to your project.
    ozm0sq8x1580.png
    Now, just press Ctrl+F5 to publish your extensions without debugging.
    A new file “.app” will be generated under the project directory
    9c1cg20ua7j2.png
  6. Development
    42jh9aap699e.png
    All functionality in Dynamics Business Central is coded in objects.
    Table objects define the table schema that hold data, page objects represent the pages seen in the user interface and Codeunits contain code for logical calculations and are saved in files with .al file extension.
    There are two other special objects which are specially used for building extensions:
    • The table extension object : Allow us to add additional fields or to change some properties on a table provided by D365BC.
    • The page extension object : Extends a D365BC page object and adds or overrides the functionality.
    A single .al file can contain multiple objects.
  7. Test Extension
    First, check that the extension is installed
    3bgda9wvzif1.png
    Now open the Customer list page and you should get this message
    qhnyowutzqyc.png

Answers

Sign In or Register to comment.