AL icon indicating copy to clipboard operation
AL copied to clipboard

GetUrl returns not working link in version 24.0

Open nvtopalov opened this issue 1 year ago • 0 comments

1. Describe the bug The system function GetUrl start returning different not working links in Version: W1 24.0 (Platform 24.0.18959.0 + Application 24.0.16410.17628) Same code below is tested on version 23.5 and it works fine, while on version 24.0 it is not working correctly.

2. To Reproduce

  1. Create a new project.
  2. Use this small test page `
page 50200 "Test GetUrl"
{
    PageType = Card;
    ApplicationArea = All;
    UsageCategory = Administration;

    layout
    {
        area(Content)
        {
            group(General)
            {
                fielD(UrlText; UrlText)
                {
                    ApplicationArea = All;
                    Caption = 'Url Text';
                    ToolTip = 'Url Text';
                    MultiLine = true;
                }
            }
        }
    }

    actions
    {
        area(Processing)
        {
            action(GenerateUrl)
            {
                ApplicationArea = All;
                Caption = 'Generate Url';
                ToolTip = 'Generate Url';

                trigger OnAction()
                begin
                    Customer.FindFirst();

                    UrlText := GetUrl(ClientType::Web, CompanyName, ObjectType::Page, Page::"Customer Card", Customer)
                end;
            }
        }
    }

    var
        Customer: Record Customer;
        UrlText: Text;
}

`

3. Expected behavior A link should be generated that is able to open the right destination.

Correct link generated deploying the code on version 23.5 https://businesscentral.dynamics.com/[TenantIdMasked]/[EvnNameMasked]/?company=[CompanyNameMasked]&page=21&bookmark=27%3bEgAAAAJ7%2f0QAMAAwADMAMAAwADAAMA%3d%3d

4. Actual behavior The link first try open Business Central, but immediately after that redirect to https://signup.microsoft.com/get-started/signup page asking to start a Business Central trial. Tested with both partner account and account in the destination tenant.

Same code deploying the code on version 24.0 returns: https://businesscentral.dynamics.com:443/?company=[CompanyNameMasked]&page=21&bookmark=27%3bEgAAAAJ7CDAAMQA0ADQANQA1ADQANA%3d%3d&tenant=[TenantNameMasked]

5. Versions:

  • AL Language: v13.0.971907
  • Visual Studio Code: 1.88.1
  • Business Central: Version: W1 24.0 (Platform 24.0.18959.0 + Application 24.0.16410.17628)
  • List of Visual Studio Code extensions that you have installed:

nvtopalov avatar Apr 30 '24 07:04 nvtopalov