STAEDEAN Business Central Documentation

BIS app structure

A new structure is created where the BIS monolith has been broken up into multiple apps. At the base of everything, there is the STAEDEAN-Common app. In a regular app-environment this means that STAEDEAN-Common is the first app to be placed on top of the Base BC app. This app will not be visible in the Extension list in Business Central and is considered to be a depend-app.

The second layer is the BIS app. This app has changed in such a way that it now only contains the business logic that is used by the former BIS-solutions Replication Management, Connectivity Studio, Notification Management and EDI-Studio. However, the BIS-app also contains the framework for Labelprinting and BC Anywhere. The BIS app will also not show up in the Extension list in BC and is also a depend-app.

The former BIS-solutions are now all separate apps. As an example, if an organisation requires Connectivity Studio, the user can install the CS app and not be bothered with Notification Management, EDI and Replication Management.

The following Apps are available in our BIS Solution:

  • STAEDEAN-Common (depend-App)
  • BIS App (depend-App)
  • Connectivity Studio App
  • Notification Management App
  • EDI Studio App
  • Replication Management App

BIS APP structure layer example

Preview_app_structure

Initialize BIS On-Premise

This manual only applies to the on-premises installation of BIS. Download the installation package and unzip the package

Make sure to run the unpacking and installation process on the same machine with the same environment to prevent Windows security from blocking the executables

From the extracted package, open the root folder, locate the file STAEDEAN BC BIS Installer.exe in the BCBIS folder and Run the file

Installing Add-ins

  • This installer copies all the required external files to the BCBIS subfolder in the server side STAEDEAN add-in folder. The default path: C:\Program Files\Microsoft Dynamics 365 Business Central\150\Service\Add-ins\To-Increase\BCBIS can be modified during the installation

Configuring the Server

To support custom functions in expressions a key must be added in the customsettings.config file of the BC Service. (default under C:\Program Files\Microsoft Dynamics 365 Business Central\150\Service\Customsettings.config )

<add key="ProtectNavAppSourceFiles" value="false" />

To update the server configuration, Run the Business Central Administration Shell (or a PowerShell instance with the modules of Business Central loaded in) To retrieve the current value

Get-NAVServerConfiguration -ServerInstance <YourInstance> -KeyName ProtectNavAppSourceFiles

This will return true or false

To Set or Create the configuration setting, execute the following command.

Get-NAVServerConfiguration -ServerInstance <YourInstance> -KeyName ProtectNavAppSourceFiles -KeyValue false -ApplyTo All

The ApplyTo options are All, ConfigFile and Memory. All updates both the value in the running instance as well as the config file. Some values can only be set in the configfile and not in memory, e.g. EnableTaskScheduler

When a change is made to only to the config file, but not in memory, the service needs to be restarted before settings are applied

Install script for BIS Apps

Create a working directory (e.g. “C:\users<you>\desktop\ToIncreaseApps” and copy all the apps (only) from the extracted package(s) to the working directory.

Only copy extensions/apps in this folder, do not copy apps that replace the base app (so-called MegaApps)

$systemApplication variable must point to the path from where the Setup was run.

  • From your desktop run Windows PowerShell ISE as administrator.

NOTES

  • Upon succesful completion of the script Extension Management will list the published and installed the extensions. The System Application shows the Dynamics 365 Business Central build number, while the STAEDEAN applications show the STAEDEAN build number. Example: 15.2.
  • 15 is the Business Central major version, must be the same between Microsoft and STAEDEAN.
  • 2 is the Business Central minor version (update), must be the same between Microsoft and STAEDEAN.
  • 39527 is the build number, will be different between Microsoft and STAEDEAN.

In Windows Powershell ISE execute the installation script below.

Installation Script for STAEDEAN Apps

Disclaimer! This script is an example and it is not supported
# Set the variables before running the script
$serverInstance = 'BC150'
$AppsFolder = 'C:\users\<you>\desktop\NewApps'

#Optional: Create a list of the requested apps, this ensures that only the apps in the list are installed and not all the apps in the $AppsFolder
#When omitting this step, all the apps available in the directory will be installed
#Remove the # prefix from TIApps

#$TIApps = "TI-Common" #Mandatory for All TI Apps

#BIS (Connectivity Studio/Replication Management/Notification Management/EDI Studio can be installed separately)
#$TIApps += ",TI-BIS"
#$TIApps += ",TI-Connectivity Studio"
#$TIApps += ",TI-Replication Management"
#$TIApps += ",TI-Notification Management"
#$TIApps += ",TI-EDI Studio"



# When running this script in a seperate session in ISE the user need to import the modules again
Import-Module "C:\Program Files\Microsoft Dynamics 365 Business Central\150\Service\Microsoft.Dynamics.Nav.Apps.Management.psd1"
Import-Module "C:\Program Files\Microsoft Dynamics 365 Business Central\150\Service\Microsoft.Dynamics.Nav.Management.psd1"




# The installation script publishes and installs the TI apps in the correct sequence
function Sort-AppFoldersByDependencies {
    Param(
        [Parameter(Mandatory=$true)]
        [string[]] $appFolders,
        [Parameter(Mandatory=$false)]
        [string] $baseFolder = "",
        [Parameter(Mandatory=$false)]
        [ref] $unknownDependencies
    )
    if ($baseFolder) {
        $baseFolder = $baseFolder.TrimEnd('\')+'\'
    }
    # Read all app.json objects, populate $apps
    $apps = $()
    $folders = @{}
    $appFolders | ForEach-Object {
        $appFolder = "$baseFolder$_"
        $appJsonFile = Join-Path $appFolder "app.json"
        if (-not (Test-Path -Path $appJsonFile)) {
            Write-Warning "$appFolder doesn't contain app.json"
        }
        else {
            $appJson = Get-Content -Path $appJsonFile | ConvertFrom-Json
            $alreadyAdded = $apps | Where-Object { $_.Id -eq $appJson.Id }
            if (-not ($alreadyAdded)) {
                $folders += @{ "$($appJson.Id)" = $appFolder }
                $apps += @($appJson)
            }
        }
    }
    # Populate SortedApps and UnresolvedDependencies
    $script:sortedApps = @()
    $script:unresolvedDependencies = $()

    function AddAnApp { Param($anApp)
        $alreadyAdded = $script:sortedApps | Where-Object { $_.Id -eq $anApp.Id }
        if (-not ($alreadyAdded)) {
            AddDependencies -anApp $anApp
            $script:sortedApps += $anApp
        }
    }
    function AddDependency { Param($dependency)
        $dependentApp = $apps | Where-Object { $_.Id -eq $dependency.AppId }
        if ($dependentApp) {
            AddAnApp -AnApp $dependentApp
        }
        else {
            if (-not ($script:unresolvedDependencies | Where-Object { $_ -and $_.AppId -eq $dependency.AppId })) {
                Write-Warning "Dependency $($dependency.appId):$($dependency.publisher.Replace('/',''))_$($dependency.name.Replace('/',''))_$($dependency.version)).app not found"
                $script:unresolvedDependencies += @($dependency)
            }
        }
    }
    function AddDependencies { Param($anApp)
        if (($anApp) -and ($anApp.Dependencies)) {
            $anApp.Dependencies | ForEach-Object { AddDependency -Dependency $_ }
        }
    }
    $apps | ForEach-Object { AddAnApp -AnApp $_ }
    $script:sortedApps | ForEach-Object {
        ($folders[$_.id]).SubString($baseFolder.Length)
    }
    if ($unknownDependencies) {
        $unknownDependencies.value = @($script:unresolvedDependencies | ForEach-Object { if ($_) { "$($_.appId):$($_.publisher.Replace('/',''))_$($_.name.Replace('/',''))_$($_.version).app" } })
    }
}
function GetAppFolders {
    Param(
        [Parameter(Mandatory = $true)]
        [string]$baseFolder,
        [Parameter(Mandatory = $false)]
        [string]$apps
    )
    $appFolders = ''
    $AllAppJsonFiles = Get-ChildItem -Path $baseFolder -Filter "app.json" -Recurse
    foreach ($AllAppJsonFile in $AllAppJsonFiles) {
        $a = Get-Content $AllAppJsonFile.fullname | ConvertFrom-Json
        if (($apps.Split(',') -contains ($a | Select-Object -expand name)) -or ($apps -eq '')) {
            Set-Location $baseFolder
            $relativePath = Get-Item $AllAppJsonFile.PSParentPath | Resolve-Path -Relative
            if ($appFolders) {
                $appFolders = $appFolders + ',' + $relativePath.Substring(2)
            }
            else {
                $appFolders = $relativePath.Substring(2)
            }
        }
    }
    return $appFolders.Replace('\', '/')
}
$appFolders = GetAppFolders -baseFolder $AppsFolder -apps $TIApps
$appFolders
Sort-AppFoldersByDependencies -appFolders $appFolders.Split(',') -baseFolder $buildArtifactFolder -WarningAction SilentlyContinue | ForEach-Object {
    Write-Host "Publishing $_"
    Get-ChildItem -Path (Join-Path $AppsFolder $_) -Filter "*.app" | ForEach-Object {
        Publish-NAVApp -Path $_.FullName -ServerInstance $serverInstance
        $name = (Get-Content (Join-Path (Split-Path $_.FullName) ('app.json')) | ConvertFrom-Json | Select-Object -expand name)
        $version = (Get-Content (Join-Path (Split-Path $_.FullName) ('app.json')) | ConvertFrom-Json | Select-Object -expand version)
        Sync-NAVApp -Name $name -ServerInstance $serverInstance -Version $version
        Install-NAVApp -Name $name -ServerInstance $serverInstance -Version $version
    }

Installing BIS Apps in Business Central

InstallBISapps.ps1

Upon succesful completion of the script Extension Management will list the published APPS now the APPS must be installed in Business Central. Please follow the instructions below.

Notes

  • Make sure to update your local path in the script to the directory where the apps are located (created in the previous step)
  • Connectivity Studio/Replication Management/Notification Management/EDI Studio can be installed separately.

Open the Dynamics Business Central Web client and go to the Setup & Extensions page. Select the required APP and select under manage “Install”.

Notes

  • Dependent apps will be installed automatically. When the Extensions has(have) been successfully installed open a Microsoft Dynamics Business Central Web client page and run the Product Registration page to Register All – Install and Enable or Upgrade the STAEDEAN products

When the Extensions has(have) been successfully installed open a Microsoft Dynamics Business Central Web client page and run the Product Registration page to Register All – Install and Enable or Upgrade the STAEDEAN products

Notes

  • Register All – will scan the customer license and show the STAEDEAN products configured in that license

  • Install – will update the database metadata for the imported objects

  • Enable – will allow access per Company to the functionality and where relevant import data like basic lifecycles

  • Register the following codeunit in the function library (which can be found through "search or in the setup of the menu") 11070243

STAEDEAN Common Documentation