NAVBaaS-Git for Microsoft Dynamics NAV
This extension provides the integration between your dockerized C/SIDE development environment and git.
The commands will take care of keeping your C/SIDE development environment in sync with your git repository so that you can focus on what's really important: developing!
If you're having trouble with the NAVBaaS.Git extension, please follow these instructions
to file an issue on our GitHub repository:
Make sure to fill in as much information as possible and try to provide a reproduction scenario.
- Git for Windows Download Link.
- Windows or Windows Server with Docker for Windows installed Follow Instructions.
- Your Dynamics NAV solution must at least be based on NAV 2016 or beyond.
- PowerShell Module: Navcontainerhelper (will be installed and managed by the extension)
- PowerShell Module: SqlServer (will be installed and managed by the extension)
This extension will add a number of settings to your Visual Studio Code User Settings, all prefixed with NAVBaaS.
When following the normal flows as described below there's no need to adjust these settings manually.
- Install the extension and press reload so that the extension can be used.
- Run Visual Studio Code with Administrator privileges.
- Execute command: NAVBaaS: Go! command and follow the steps.
- Move your splitted objects (text files) to the modified folder.
It is required to use the default file naming conventions, for example: TAB1, COD1, PAG1.
- Stage and commit your files.
- Execute command: NAVBaaS: Create Container command to create your dockerized C/SIDE development environment.
- Execute command: NAVBaaS: Sync. command to initially import all the objects from your git repository.
If you already have your solution in git, please be aware that by default, the extension expects the following two folders in the root:
You can change this by adjusting the following user settings:
Below you can find a list of all the commands together with a brief explanation.
Command used to initially setup the extension on your machine, it will perform the following actions:
- Select your git repository.
- Initialize the folder structure in your git repository.
- Select your Dynamics NAV development license.
- Install the required PowerShell modules.
NAVBaaS: Open Git Repository Folder
Opens your configured git repository folder.
NAVBaaS: Create Container
Command used to create your C/SIDE development environment in a Docker container.
You will be prompted to enter the following information:
- Container Name.
- Docker Image Name on which your solution is based. For example Microsoft/dynamics-nav:2018-cu5-nl
- Authentication Type: can be either NavUserPassword (recommended) or Windows.
- Which database to use: Cronus or your own .bak file.
*Only when a container is successfully created it will be stored in your user settings under: NAVBaaS.Containers.
*Only containers created through this command can be used with the Sync. command.
NAVBaaS: Remove Container
Command to remove your container when you're done with it.
Please always remove your containers through this command so that related settings, folders etc. can also be cleaned up.
Command used to keep your git repository and Dynamics NAV development container in sync.
The command handles the following tasks in one go:
- Determine if there are any conflicts.
If that's the case the synchronization will stop - conflicts should be handled manually by using a compare tool.
- Import changed objects from your git repository to your NAV dev. container.
- Export and commit changed objects (based on modified flag) from your NAV dev. container to your git repository.
- Remove objects which are deleted from your git repository from your NAV dev. container.
- Compile uncompiled objects.
- Synchronize schema changes.
Please note that when modified objects are exported from your NAV dev. container, a fixed DateTime property will be set on the object.
This is done to prevent conflicts when multiple developers are working on the same file(s).
NAVBaaS: Sync. Preview
Command used to preview the synchronization of the container without performing the import, export or delete.
NAVBaaS: Sync. Schema Changes
Command used to perform the schema synchronization inside the container.
This can be handy when you make changes to the schema through C/SIDE and saving the table with validation does not work.
NAVBaaS: Compile Objects
Can be used to compile objects inside the container.
This can be handy when you cannot compile an object through C/SIDE because of server side dll dependencies.
Can be used to make object comparisons, the following scenario's are supported:
- Compare an object from the original folder with an object from the modified folder.
- Compare an object from the modified folder with an object from your database (inside the container).
The extension can only track deletions/renames if they're done directly on the file, so not in C/SIDE.
Please follow the steps below to delete an object:
- Remove the file from your Git repository.
- Commit the change.
- Use the NAVBaaS Sync command to also remove the object from your database.
The same procedure applies when you want to renumber an object, always make the change in Git and then use the NAVBaaS Sync command.
Adding functionality yourself
If you need functionality before or after creating the container you can use the two following settings in your user settings.
OnBeforeCreateContainerScriptPath - will be executed before the container is created, the following variables can be used:
- $AdditionalParameters - will be passed to the New-NavContainer command (navcontainerhelper module).
- $IncludeTestToolkit - true by default.
- $DoNotExportObjectsToText - true by default.
- $EnableSymbolLoading - true by default.
OnAfterCreateContainerScriptPath - will be executed after the container is created, the following variables can be used:
- $ContainerName - name of the created container.
- $DockerImageName - name of the used docker image.
Richard Robberse - Robberse IT Services
Feedback is important!
Feedback is more than welcome, you can give me feedback through the following channels:
Visual Studio Code Marketplace