Wednesday, June 20, 2018

Docker Useful Command Collection

Hello Friends,

Here i will list down the useful command require for Docker to run NAV365BC Image as docker container

Run command docker version to confirm that docker is installed and running.
If it's installed and running you will see an output as in below screenshot. If not then run the docker from the desktop shortcut or from the start menu.

















Download Docker Image, List Image, Create/Delete/List Container - command list























NAV Container Command
























Run command docker pull microsoft/bcsandbox:us to download the image for Business Central US version.

Using an object-oriented programming analogy, the difference between a Docker image and a Docker container is the same as that of the difference between a class and an object. An object is the runtime instance of a class. Similarly, a container is the runtime instance of an image.

Run PowerShell command –
Set-ExecutionPolicy RemoteSigned

We will be running the script and by default, PowerShell stops running scripts. Run above command to set Execution Policy to Remote Signed.


install-module navcontainerhelper -force

navcontainerhelper is a PowerShell Module, which can be installed from the PowerShell Gallery by using above cmdlet.

docker images

Above command will list down all the images that you have downloaded till now. If you have already run download image in the last section you should see one image as shown below.

Sunday, June 17, 2018

VS Code - AL Language Useful Code Snippets

Hello Friends,

Very useful AL Code snippets, which can increase your work efficiency..


VS Code - Launch.Json and App.Json file parameters

Hello Friends,

This blog is content detail about all parameter detail about this 2 important configuration file.

Json Configuration Files

JSON stands for JavaScript Object Notation, which is a lightweight data interchange format, often used for storing and transporting data. In an AL project there are two JSON files: the app.json file and the launch.json file. These files are automatically created when you start a new AL project. These files are used to store configuration data about your AL project. The app.json file contains information about the extension you are building, such as publisher information, the name and the version of the extension.

Launch.json file

The launch.json is a configuration file that contains information about the server that the extension launches on. There are two configurations depending on whether the extension is published to a local server or to the cloud.


Let’s discuss some important and mandatory properties.

Publish to local server settings


Setting
Mandatory
Value
name
Yes
Name of your configuration, for example "Local dev server"
type
Yes
Must be set to “.al”. Required by Visual Studio Code
request                     
Yes
Must be set to “launch”. Required by Visual Studio Code
server
Yes
The HTTP URL of your server, for example “http://localhost”
serverInstance
Yes
The instance name of your server, for example: “D365”
authentication
Yes
Specified the server authentication method
startupObjectId
Yes
Specified the ID of the object to open after publishing. Only objects of type Page and Table are currently supported
startupObjectType
Yes
Specifies with type of object to open after publishing. This is used in combination with the setting “startupObjectId”. Only objects of type Page and Table are currently supported
schemaUpdateMode
No
Specifies the data synchronization mode when you publish an extension to the development server: "Synchronize” or “Recreate". The default value is Synchronize. With Synchronize the existing data is kept, while Recreate will delete the existing data.

Publish to cloud settings

Setting
Mandatory
Value
name
Yes
Name of your configuration, for example "Local dev server"
type
Yes
Must be set to “.al”. Required by Visual Studio Code
request
Yes
Must be set to “launch”. Required by Visual Studio Code
serverInstance
Yes
The instance name of your server, for example: “US”
startupObjectId
Yes
Specified the ID of the object to open after publishing. Only objects of type Page and Table are currently supported
startupObjectType
Yes
Specifies with type of object to open after publishing. This is used in combination with the setting “startupObjectId”. Only objects of type Page and Table are currently supported

App.json file 

The app.json file contains information about the extension that you are building, such as publisher information, name and the minimum supported version. Often the app.json file is referred to as the manifest.


Setting
Mandatory
Value
id
Yes
The unique ID of the extension. When the app.json file is automatically created, the ID is set to a new GUID value
name
Yes
The unique extension name
publisher
Yes
The publisher name
brief
No*
Short description of the extension
description
No*
Longer description of the extension
version
Yes
The version of the app package
platform
Yes
The minimum supported version of the platform symbol package file
application
Yes
The minimum supported version, for example “application”: “11.0.0.0”
idRange
Yes
A range for application object IDs. Objects outside the range will raise a compilation error. A new ID is automatically suggested. The allowed range is provided to you from Microsoft.

* Required for AppSource submission 
JSON stands for JavaScript Object Notation, which is a lightweight data interchange format, often used for storing and transporting data. In an AL project there are two JSON files: the app.json file and the launch.json file. These files are automatically created when you start a new AL project. These files are used to store configuration data about your AL project. The app.json file contains information about the extension you are building, such as publisher information, the name and the version of the extension.

Launch.json file

The launch.json is a configuration file that contains information about the server that the extension launches on. There are two configurations depending on whether the extension is published to a local server or to the cloud.