Build and Deploy an APP in NAV 2018 and in MSDYN365BC On-premise – Fast Checklist

Build and Deploy an APP in NAV 2018 and in MSDYN365BC On-premise – Fast Checklist

FAST CHECKLIST TO BUILD AND DEPLOY AN APP

Hi people, my book about NAV 2018 and Business Central On-premise https://www.packtpub.com/application-development/implementing-microsoft-dynamics-365-business-central-premise-fourth-edition is not a development book (there are others published and others are going out), it is a book on the implementation of NAV and Business Central; some people, however, asked me for a short checklist to be immediately operational on VS Code and AL (there are people who have not yet seen anything); I have therefore created a short checklist for those who want to start developing in a short time. Fast checklist designed for On-premises environments (NAV 2018 and BC) where Powershell can also be used. There are still many posts on other very interesting blogs (they are almost courses).

Fast Checklist: “Installation and configuration scenario for Dynamics NAV 2018 and Dynamics 365 Business Central On-premise”.

#1 Check Development Service Port, Endpoint Enables, Download of Symbols, Extensions Target Level

Check\ Activate the Development Service Port > example: Port 7859, Enable Development Service Endpoint = TRUE, Enable load application symbol reference at server restart = TRUE, Allowed ExtensionsTarget Level: EXTENSION (only extensions in this case, developments ready to SaaS!).

NOTES ABOUT “EXTENSIONS TARGET LEVEL”

When you develop an extension with Visual Studio Code and the AL language,  in the app.json file you can specify the target level of your extension. The available options are as follows: Extension, Internal, Personalization, Solution.

ExtensionTargetLevels

In this scenario i want to talk only about two of them: extensions and Internal

  • Extension: it’s the default level when you create an extension for Dynamics 365 Business Central. This is used for an extension that targets the online world (only FunctionVisibility = External, no DotNet variables, no Files Management but use Stream instead).
  • Internal: This is the highest level and it targets the on-premise world (maximum visibility, full DotNet support, File Management, access to all Virtual Tables like Files etc.).

#2 Restart NAV 2018 Service, Automatic download of Symbols

Restart NAV 2018 Service, after restart, system automatically downloads symbols and makes them usable for AL development.

Or press Ctrl+Shift+P and select AL: Download symbols in VS Code

#3 Install VS Code (Visual Studio Code)

You can download\install VS Code from here: https://code.visualstudio.com/ Install is simple: Next, Next, Done.

#4 Launch VS Code, Install Microsoft AL Language extension for Dynamics NAV or Business Central On-Premise loading “.VSIX” file.

Click “Install from VSIX…”option, you can load .VSIX file from DVD (Dynamics NAV or Business Central On-premise.

Extensions > “Install from VSIX…”option.

In this case, “.VSIX” file load AL Extension Language for Business Central On-premise

Now, you need to configure these two files necessary to use correctly AL Extension Language in VS Code to develop, publish and install APPS.

  • Launch.json
  • App.json

#5 CONFIGURE THE “LAUNCH.JSON” FILE (INFO FOR APP DEVELOPMENT)

In this file you can configure:

  • Server (ex: local or Cloud Sandbox for Business Central SaaS) with development port
  • Instance
  • Authentication Model
  • ..and many other options…

#6 CONFIGURE “APP.JSON” (INFO FOR APP PUBBLICATION)

In this file you can configure:

  • App Name
  • Publisher Name
  • Version, Privacy, logo, help, info for publication
  • Application and Platform (useful for On-premise)
  • Dependencies (if you need\have)
  • Object range (ex: 50100 to 50149)
  • .. other options

#7 – HOW TO EXPORT BASELINE FROM DYNAMICS NAV OR BUSINESS CENTRAL

FIRST: COMPILE ALL OBJECTS!

EXAMPLE: EXPORT A COMPLETE BASELINE (BUSINESS CENTRAL W1 – ALL BASELINE OBJECTS)

Command: “finsql.exe Command=ExportToNewSyntax

Example: finsql.exe Command=ExportToNewSyntax, File=ALLSourceObj.txt, Database=”Demo Database NAV W1 (13-0)”, ServerName=mvpdockers\SQL2016EXP

SCENARIO EXAMPLE: EXPORT ALL OBJECTS “50000”

Tables

finsql.exe Command=ExportToNewSyntax, File=ALLtables50000.txt, Database=”Demo Database NAV W1 (13-0)”, ServerName=mvpdockers\SQL2016EXP,Filter=Type=table;ID=50000..50100

Pages

finsql.exe Command=ExportToNewSyntax, File=ALLpages50000.txt, Database=”Demo Database NAV W1 (13-0)”, ServerName=mvpdockers\SQL2016EXP,Filter=Type=page;ID=50000..50999

Reports

finsql.exe Command=ExportToNewSyntax, File=ALLreport50000.txt, Database=”Demo Database NAV W1 (13-0)”, ServerName=mvpdockers\SQL2016EXP,Filter=Type=report;ID=50000..50999

Codeunits

finsql.exe Command=ExportToNewSyntax, File=ALLcodeunits50000.txt, Database=”Demo Database NAV W1 (13-0)”, ServerName=mvpdockers\SQL2016EXP,Filter=Type=codeunit;ID=50000..50999

#8 – HOW TO CONVERT TXT TO AL: “TXT2AL.EXE”

“TXT2AL EXPORT.EXE” Converter convert C/AL Code to AL Language

EXAMPLE: txt2al.exe –source=”C:\ALFILES\SOURCES” –target=”C:\ALFILES\CONVERTED”

#9 – (RE)GENERATE SYMBOLS (IF YOU HAVE ERRORS) IN MANUAL WAY (FORCE)

finsql.exe Command=generatesymbolreference , Database=”Demo Database NAV W1 (13-0)”, ServerName=mvpdockers\SQL2016EXP

Or press Ctrl+Shift+P and select AL: Download symbols from VS Code

EXAMPLE

#10 – OPEN IN ONBJECTS IN VSCode + Microsoft AL Language

You can start using VS Code with this commands:

Ctrl+Shift+P Show All Commands in palette

Alt+A Alt+L AL Go! Command generate a HelloWorld Project

OR open Your Project…

Always check the Runtime!

#11 – PUBLISH AN APP

PUBLISH AN “.APP” (ex: a RDLC Report in this case)

PUBLISH “.APP”: To publish an app:

Publish-NAVApp –ServerInstance DynamicsNAV130IT –Path “C:\Users\vmadmin\Documents\AL\ReportSalesInvoiceWL\Roberto Stefanetti_ReportSalesInvoiceWL_1.0.0.1.app”-SkipVerification

OR from VS Code

F5 Publish

Ctrl+Shift+B Build Package (Compile and build the solution)

APP is now published but not installed

#12 – INSTALL AN APP

INSTALL “.APP”: To install an app:

Install-NAVApp –ServerInstance DynamicsNAV130IT –Name “ReportSalesInvoiceWL”

OR from VS Code

Ctrl+Shift+B Build Package (Compile and build the solution)

Ctrl+F5 Build and deploy

In this case the APP is successfully installed

OR you can install manually:

You can upload manually an APP in Dynamics NAV and in Microsoft Dynamics 365 Business Central using Upload “.APP” in Extension Management manually

EXTENSION IS INSTALLED

#13 – “HOW TO” UN-INSTALL AN APP

You can un-install an APP manually or from powershell

Powershell

Example: Get-NAVAppInfo -ServerInstance BC -Name ‘Proseware SmartApp’ -Version 2.3.4.500 | Uninstall-NAVApp -Tenant ‘Tenant1’ Gets the tenants where the specified NAV App is installed

Example: Uninstall-NAVApp -ServerInstance BC -Name ‘Proseware SmartApp’ -Version 2.3.4.500 -Tenant ‘Tenant1’ Remove the installed App.

Manually

#14 – “HOW TO” SIGNING AN APP (NECESSARY TO PUBLISH AN APP ON MICROSOFT APP STORE)

Follow this link: https://docs.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/devenv-sign-extension

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Enjoy this blog? Please spread the word :)

%d bloggers like this: