microsoft / microsoft/AL

forceUpgrade does not work anymore

Open
#7,037 19 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

input-needed
Dominant language
PowerShell
Stars
881
Forks
285
Avg merge
3d 36m
Merged PRs (30d)
1

Description

1. Describe the bug
Since BC 20 or longer, forceUpgrade set in the launch.json does not work anymore: As long as the app version number is unchanged, the upgrade codeunit execution is not triggered.

2. To Reproduce
Publish an app in dev scope.

Without changing the app version, add an upgrade codeunit with a breakpoint in the OnUpgradePerCompanyTrigger.

codeunit 50000 "My Upgrade"
{
    Access = Internal;
    Subtype = Upgrade;

    trigger OnUpgradePerCompany()
    begin
        // Set your breakpoint here, or throw message
    end;
}

In the launch.json, set
"forceUpgrade": true

Publish all changes with debugging, or publish and wait for a message: The upgrade codeunit is not called.

3. Expected behavior
As in earlier versions, the upgrade codeunit should be run.

4. Versions:

  • AL Language: v9.0.615906
  • Visual Studio Code: 1.67.1
  • Business Central: DE Business Central 20.0 (Platform 20.0.37114.40239 + Application 20.0.37253.40281)
  • List of Visual Studio Code extensions that you have installed: unrelated

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the launch.json forceUpgrade setting and reproduce the issue using the AL upgrade codeunit and its OnUpgradePerCompany trigger, as described. Compare the behavior with earlier Business Central versions or the documented expectation; done means the upgrade codeunit runs when forceUpgrade is true without changing the app version.

Written by the indexing model from the issue text.

Assessment

Tech stack
vscode
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.