Dependent extensions/ apps in Business Central

Recently I observed that when publishing a newer version of an extension through VS Code, all the dependent extensions are getting unpublished and then I had to publish those again and one of the extension was of another vendor and there was a requirement of license for publishing their extension and hence there was need to contact them whenever a newer version of our extension was published through VS Code.

In this blog, we will discuss about following:

1. Find all the dependent apps/ extensions of a extension/app

2. Installing (or upgrading) a newer version of an extension which has some dependent apps through Business Central Administration Shell so that dependents Apps don't get unpublished

While I was searching for a solution to find all the dependent apps, I came across this blog  ( https://dankinsella.blog/uninstall-all-dependant-apps-in-business-central-on-premise/ ) in which author is talking about the script to uninstall all dependent apps, thanks to him.

$searchApp = 'YourAppName'
$apps = get-navappinfo YourServerInstanceName    //This will have the list of all the apps installed on the server instance
foreach ($app in $apps) //loop for each app in instance
{
$appdetail = Get-navappinfo YourServerInstanceName -name $app.Name
foreach ($dependency in $appdetail.Dependencies) {
if ($dependency.Name -eq $searchApp) {
Write-Host 'Dependent App :' $appDetail.Name ' ' $appDetail.Version
//Uninstall-Navapp uat -name $appDetail.Name   //Uncomment this line of code only if you want to uninstall the dependent app, but in case you just to list down all dependent app then do not use/ uncomment this line
}
}
}

 Installing (or upgrading) a newer version of an extension which has some dependent apps through Business Central Administration Shell so that dependents Apps don't get unpublished :

Publish, Sync, Upgrade through commands in Business Central Administration Shell and then unpublish previous version from modern client of Business Central using Extension Management page.

You can find relevant MS official documentation on following link: https://docs.microsoft.com/en-us/dynamics365/business-central/dev-itpro/upgrade/upgrade-publish-extensions

Publish-NAVApp -ServerInstance <ServerInstanceName> -Path <ExtensionFileName>

Sync-NavApp -ServerInstance <ServerInstanceName> -Name  <ExtensionFileName>  -Version N.N.N.N -Tenant <TenantID>

Start-NAVAppDataUpgrade -ServerInstance <ServerInstanceName> -Name <Name> -Version <N.N.N.N>

Install-NAVApp -ServerInstance <ServerInstanceName> -Name <Name> -Version <N.N.N.N>

After this go to Business Central client and open Extension Management page, there you will find previous version of your App in uninstalled state from there you can unpublish it.

In case there is any other better way to do this, then please write that in the comment and I would happy to include that.

Comment List
Anonymous
Related
Recommended