AL icon indicating copy to clipboard operation
AL copied to clipboard

How to get Visual Studio Code to call LOADPACKAGEDATA when pressing F5

Open AMCJN opened this issue 9 years ago • 5 comments

We have a *.navxdata file in our extension.

Is it possible that LOADPACKAGEDATA located in our service upgrade codeunit can be called when pressing F5 in Visual Studio Code ?

Because this data is essential for testing/programming the extension.

Please advice how to if possible.

AMCJN avatar Sep 05 '17 08:09 AMCJN

I have another - opposite issue. When I

  • press Ctrl+F5
  • fill data in my extension
  • go to : Extension management
  • Uninstall my extension
  • Unpublish my extension
  • go to VS Code and press Ctrl+F5 once again, all data that I inputted before - exist!

I don't understand how it works, cos I don't have any upgrade codeunits ;) This is bug or feature ? ))

DmitryKatson avatar Sep 05 '17 13:09 DmitryKatson

@AMCJN - the upgrade codeunits for V2 are currently undergoing changes so it's not possible to hook up the LoadPackageData call to F5

@dkatson - this is currently intentional, but not complete. In a few updates it will be possible to decide what happens to the extension data when unpublishing.

StanislawStempin avatar Sep 07 '17 13:09 StanislawStempin

Thanks Stan for the answer.

But does the LoadPackagesData works, when the extensions is Publish/Installed normally ? We are quite dependent on that our package data is loaded when installing the extension, otherwise we/the customer can not use the extension for anything.

AMCJN avatar Sep 08 '17 06:09 AMCJN

Unfortunately it looks that LoadPackageData is not re-enabled yet. The API will be finalized by November Update at the latest.

StanislawStempin avatar Sep 11 '17 15:09 StanislawStempin

It will be available in October Update. This is the way to use it:

codeunit 70022222 InstallCu
{
    Subtype = Install;

    trigger OnInstallAppPerCompany();
    begin
        NavApp.LoadPackageData(700000001);
    end;

OR

    trigger OnInstallAppPerDatabase();
       NavApp.LoadPackageData(700000001);
    begin

    end;
}

StanislawStempin avatar Sep 14 '17 19:09 StanislawStempin