My first Dynamics 365 Extension – step by step – fifth step

Development and installation.

For my development I use source control management.  Soren Klemmensen did a short demo of that setup in his session in NAV TechDays 2016.  We are working on making that solution public in a few months.  In every branch we have a setup file in a json format. That file has all the parameters needed to build an extension.  Here is the one I use for the G/L Source Names project.  When I have this Extension completed I will publish it to my GitHub Account.

  "navVersion": "10.0.14199.0",
  "navProduct": "GLSOURCENAMES",
  "projectName": "NAV2017",
  "baseBranch": "master",
  "uidOffset": "70009200",  
  "versionList": "GLSN10.0",
  "objectProperties": "true",
  "datetimeCulture": "is-IS",
  "appId": "479e77f3-031a-49fe-bb6a-314464c6a9a8",
  "appName": "G/L Source Names",
  "appPublisher": "",
  "appVersion": "",
  "appCompatibilityId": "",
  "appManifestName": "G/L Source Names",
  "appManifestDescription": "G/L Source Names adds the source name to the G/L Entries page.  Source Name is the customer in sales transaction and the vendor in purchase transactions", 
  "appBriefDescription": "Source Names in G/L Entries",
  "appPrivacyStatement": "",
  "appEula": "",
  "appHelp": "",
  "appUrl": "",
  "appIcon": "Logo250x250",  
  		{"id": "G/L-SOURCE NAMES",    "description": "Read G/L Source Names"},
  		{"id": "G/L-SOURCE NAMES, E", "description": "Update G/L Source Names"},
  		{"id": "G/L-SOURCE NAMES, S", "description": "Setup G/L Source Names"}

For every extension we need to make sure that the installation and configuration experience for the customer is easy.  When the Dynamics 365 for Financials user open the Extension Management page our Extension should be visible there.

Here we can see that we need to create images for our Extensions. Later in the process, when we register the Extension on AppSource we will need to supply images in different sizes for out Extension. The image that I used when I created my Extension is 250×250 points. Starting the installation will take the user through an installation wizard. In the installation process the user sees all the properties we add to the Extension manifest definition. I create the manifest with the following code.

$appManifastFilePath = (Join-Path $ExtensionPath "AppManifest.xml")
$appPackageFileName = (Join-Path $ExtensionPath 'AppPackage.navx')

$params = @{ 
  Id = $SetupParameters.appId
  Name = $SetupParameters.appManifestName 
  Publisher = $SetupParameters.appPublisher 
  Version = $SetupParameters.appVersion 
  Description = $SetupParameters.appManifestDescription }
if ($SetupParameters.appBriefDescription -ne "") { $params.Brief = $SetupParameters.appBriefDescription }
if ($SetupParameters.appCompatibilityId -ne "") { $params.CompatibilityId = $SetupParameters.appCompatibilityId }
if ($SetupParameters.appPrivacyStatement -ne "") { $params.PrivacyStatement = $SetupParameters.appPrivacyStatement }
if ($SetupParameters.appEula -ne "") { $params.Eula = $SetupParameters.appEula }
if ($SetupParameters.appHelp -ne "") { $params.Help = $SetupParameters.appHelp }
if ($SetupParameters.appUrl -ne "") { $params.Url = $SetupParameters.appUrl }
if ($SetupParameters.appPrerequisities -ne "") { $params.Prerequisites = $SetupParameters.appPrerequisities }
if ($SetupParameters.appDependencies -ne "") { $params.Dependencies = $SetupParameters.appDependencies }

New-NAVAppManifest @params | New-NAVAppManifestFile -Path $appManifastFilePath -Force

The image and a set of screenshot images are used when creating the Extension package file (navx).

if ($SetupParameters.appIcon -ne "") {  
  $iconPath = (Get-ChildItem -Path $ImagesPath -Filter ($SetupParameters.appIcon + "*")).FullName
} else {
  $iconPath = ""

if (Test-Path $ScreenshotsPath) {
  $screenShots = (Get-ChildItem -Path $ScreenshotsPath).FullName
} else {
  $screenShots = @{}

$params = @{
      Path = $appPackageFileName 
      SourcePath = $ResourceFolder }
if (Test-Path $iconPath) { $params.Logo = $iconPath }
if ($screenShots.Length -gt 0) { $params.ScreenShots = $screenShots }

Get-NAVAppManifest `
  -Path $appManifastFilePath `
  | New-NAVAppPackage @params -Force

In the below screenshots you should be able to see how my parameters are used in the installation process.  I have not yet seen my screenshots used in the Extension installation.

Web links, in the order of appearance are the appUrl, appHelp, appEula and appPrivacyStatement parameters.

Installation done and the user has logged in again and ready to start the Extension setup process.

If the Extension contains any tables then it must also contain permission sets for every table.  From the parameters above you can see that I have three permission sets for my Extension.  One for read permissions, second for update permissions and the third for the Extension setup permissions.  I expect that the user that is installing the Extension has full permissions and is able to assign permissions to other users.

In a simple Extension like this, Extension that does not require any company based setup we still need to make sure that every user has the required permissions to use the Extension.  For this task I use the Assisted Setup feature.

Catch my next blog to read all about that.


Leave a Reply

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