In Business Central 2019 release wave 2 we’re introducing a shift in the story around customization. In fact, it’s a big step toward a future where the term “extend” has replaced “customize.”
Note: Because the System Application is part of Business Central 2019 release wave 2 it isn’t yet publicly available. To get access you’ll need to join the ReadyToGo program so that you can use Microsoft Collaborate and our insider builds.
This example will walk you through the following steps:
- Get the latest Docker image.
- Prepare the environment for code customization.
- Publish and install a new version of System Application.
- Share your great work with others.
Get the latest Docker image
Start by pulling the latest Docker image (current walkthrough based on build 15.0.34197). To do that, run the following command.
docker pull bcprivate.azurecr.io/bcsandbox-master:base-ltsc2019
$credential = New-Object System.Management.Automation.PSCredential -argumentList "admin", (ConvertTo-SecureString -String "P@ssword1" -AsPlainText -Force)$imageName = "bcprivate.azurecr.io/bcsandbox-master:base-ltsc2019"$licensePath = "C:..l.flf" #put actual path to your license$containerName = "BC"New-BCContainer -accept_eula ` -updateHosts ` -containerName $containerName ` -auth NavUserPassword -Credential $credential ` -imageName $imageName ` -licenseFile $licensePath ` -doNotExportObjectsToText ` -includeAL ` -useCleanDatabase ` -memoryLimit 16g `
The container will start as a process and the output of the function will display in the PowerShell output. Among other parameters we can find the URL for the web client, which we’ll open in a later step. Now we need to replace the standard System Application from Docker image with our own version.
Run the following cmdlet to uninstall and unpublish System Application:
UnPublish-NavContainerApp -containerName $containerName ` -appName "System Application" ` -unInstall ` -doNotSaveData
Prepare the environment for code customization
We now have a blank environment, but we can’t use it yet because it’s missing a few application objects (for example, the default Role Center) that are required.
Let’s open VS Code and start enhancing an existing module or building our own version of the System Application.
Note: We need the latest version of the AL extension for VS Code. The PowerShell output contains the link to the .vsix file, so we can download it from the container.
1. In VS Code, run the AL:Go! command to create a new AL Project, and then choose 4.0 as the Target Platform.
Note: The project folder should be in a location that is shared with the container. For example, a folder in C:ProgramDataNavContainerHelper will work.
2. Update the Server and Server Instance parameters in the launch.json file with values from the PowerShell output.
3. Delete the HelloWorld.al and app.json files.
- In GitHub, choose the Clone or Download button, and then Download ZIP.
- Open the downloaded archive and copy the content of the ALAppExtensions-masterModulesSystem folder to our AL project.
Now we have the latest version of the System Application and can download symbols and make enhancements.
Publish and install your System Application
When we’re done, we’ll package the System Application without publishing it.
To publish and install a new version of the System Application, we’ll run the following cmdlet in PowerShell:
Publish-NavContainerApp -containerName $containerName ` -appFile "C:ProgramDataNavContainerHelperALDemoSolutionMicrosoft_System Application_15.0.0.0.app" ` -skipVerification ` -sync ` -syncMode ForceSync ` -install
Now let’s open a web browser and check out how our enhanced System Application works.
We’ll repeat the UnPublish-NavContainerApp, modify AL, and Publish-NavContainerApp steps until we’re happy with the results.
Share your improvement
The System Application is a work in progress, and new modules will be added in the future. If you want to peek at the latest, you can always go to the GitHub repository https://github.com/Microsoft/alappextensions. While you’re there, if you see something you think we’ve missed, you can submit a pull request and we might add it. Additionally, if you think we’ve left out a module, you can submit an idea on https://aka.ms/bcideas.
The post Customization INSIDE the System Application in Dynamics 365 Business Central appeared first on Dynamics 365 Blog.