As a Microsoft Partner we are often tasked with installing extensions from Microsoft AppSource into our clients Business Central environment. This was once a simple task, but as we moved from the Delegated Administrative Permissions (DAP) to Granular Delegated Administrative Permissions (GDAP) there have been some changes. One major change is that clicking on the installation link as a GDAP authenticated partner does not install the Extension into the clients Business Central Environment.
There is an excellent article about this on EPS Software Blog. Ben Cole, David Kolenko, Stefano Demiliani, and many others have done some great work sorting out a work-around, I recommend taking a look at the blog and their posts on LinkedIn. They found that an edit to the AppSource URL would effectively redirect the install to the proper Tenant, where you can then select the target client environment.
There are several manual steps involved in the process of generating the GDAP friendly URL. My coworker Adam Orgeron and I thought that this can be automated with a Page Extension.
Here is the “Microsoft AppSource Apps” page. The ERP Software Blog article outlines that this page has all the data we need to add a new column with the appropriate GDAP friendly link. Let’s extend the page with a calculated field with the GDAP friendly link.

We created a page extension that adds an “AppSource GDAP Link” column.
pageextension 50000 "ARD_AppSource Product List" extends "AppSource Product List"
{
layout
{
// Add changes to page layout here
addafter(DisplayName)
{
field(AppSourceLink; AppSourceLink)
{
ExtendedDatatype = url;
ApplicationArea = all;
Caption = 'AppSource GDAP Link';
ToolTip = 'AppSource GDAP Link';
}
}
}
actions
{
// Add changes to page actions here
addafter(OpenAppSource)
{
action(AppSourceUrl)
{
Caption = 'Open AppSource Url';
ToolTip = 'Open AppSource Url';
Image = Link;
ApplicationArea = All;
trigger OnAction()
begin
AppSourceLink := GenerateLink();
System.Hyperlink(AppSourceLink);
end;
}
}
addafter(Open_Promoted)
{
actionref(AppSourcePromo; AppSourceUrl)
{
}
}
}
var
AppSourceLink: text;
trigger OnAfterGetRecord()
var
begin
AppSourceLink := GenerateLink();
end;
// This procedure generates a URL link for a Business Central application page.
// The generated link includes the tenant ID and a filter for the application ID.
//
// Returns:
// Text: The generated URL link.
//
// Example:
// https://businesscentral.dynamics.com/TenantID/?noSignUpCheck=1&filter='ID'%20IS%20'AppID'&page=2503
//
// Variables:
// AppID: Text - The application ID after removing curly braces.
// AppURL: Text - The generated URL link.
procedure GenerateLink(): Text
var
AppID: Text;
AppURL: Text; //https://businesscentral.dynamics.com/TenantID/?noSignUpCheck=1&filter=%27ID%27%20IS%20%27AppID%27&page=2503
begin
AppId := DelChr(rec.AppID, '<>', '{}');
AppURL := 'https://businesscentral.dynamics.com/' + GetTenantID() + '/?noSignUpCheck=1&filter=%27ID%27%20IS%20%27' + AppID + '%27&page=2503';
exit(CopyStr(AppURL, 1, 2048));
end;
/// <summary>
/// Retrieves the Tenant ID from the current web client URL.
/// </summary>
/// <remarks>
/// This method uses a regular expression to find and extract a GUID (Tenant ID) from the URL.
/// </remarks>
/// <returns>
/// A text value representing the Tenant ID if found; otherwise, an empty string.
/// </returns>
/// <example>
/// <code>
/// var
/// TenantId: Text;
/// begin
/// TenantId := GetTenantID();
/// end;
/// </code>
/// </example>
procedure GetTenantID(): Text
var
TempMatches: Record Matches temporary;
Regex: CodeUnit Regex;
Pattern: Text;
TenantId: Text;
begin
Pattern := '[({]?[a-fA-F0-9]{8}[-]?([a-fA-F0-9]{4}[-]?){3}[a-fA-F0-9]{12}[})]?';
Regex.Match(GetUrl(ClientType::Web), Pattern, TempMatches);
if TempMatches.FINDFIRST() then
TenantId := TempMatches.ReadValue();
exit(TenantId);
end;
}
Once published the Microsoft AppSource Apps page now includes a column of GDAP friendly links:

Note that if you want to implement this yourself, the id of 50000 may need to be changed.
You can review the code in my GitHub: ARD_AppSourceProductList.PageExt.Al
There is also an Extension available: AardvarkMan/GDAP-AppSource
Fun things to note in the code, it uses a Regular Expression to parse out the Tenant Id from the web URL.
I hope this helps my fellow partners out with their AppSource installs. Thank you and credit due to everyone that has been working on this challenge.
UPDATE
If you don’t feel like installing an App Extension, you can use this tool cat ERP Connect to generate a link: AppSourceDownload – ERP Connect Consulting





Leave a comment