Work smarter, not harder, with global code actions!

Recently I got a question about making 26000 changes to a large extension. Thankfully, there are ways to have it done in seconds. Check out the video:

https://youtu.be/fhao1Oz1aNE

In this video, Erik demonstrates how to tackle large-scale code maintenance tasks in AL for Business Central — specifically, how to fix thousands of implicit with usages and missing tooltips across an entire project in just seconds, rather than hours of manual editing. The secret? Global code actions provided by the AZ AL Dev Tools extension.

The Problem: 26,000 Edits?

Erik received a question on LinkedIn from someone maintaining a Business Central app. They needed to remove implicit with statements — adding explicit Rec. prefixes in front of field references throughout their codebase. The scale of the problem? Approximately 26,000 places that needed editing. That’s a massive amount of manual work.

But as Erik puts it: we can get a computer to do it, and get it done in a couple of minutes.

The Tool: AZ AL Dev Tools

The key to this productivity boost is the AZ AL Dev Tools VS Code extension, created by Andrzej Zwierzchaczewski (Andres). Erik has recommended this extension many times and continues to do so — he uses parts of it every single day. It provides powerful global code actions that can process an entire project at once.

Demo: Removing Implicit With Statements

Erik opens an older app — a Certify expense management integration that was created several years ago and hasn’t received much attention since. The code uses implicit with statements, where field names like Expense State and Employee ID are referenced without the explicit Rec. prefix.

When you enable the NoImplicitWith rule in your app.json, you’ll see errors everywhere these implicit references exist. Fixing them manually would be extremely tedious. Instead, Erik uses the AZ AL Dev Tools command:

  1. Open the VS Code Command Palette
  2. Run “Remove With Usage from the Active Project”
  3. When prompted “Do you want to run this command for all files in the current project folder?” — click Yes

The extension processes all project files, automatically adding Rec. in front of every implicit field reference. The entire operation takes just seconds.

Demo: Adding Missing Tooltips

With the implicit with issues resolved, Erik notices the project also has warnings about missing tooltips — a common requirement for AppSource apps. Again, AZ AL Dev Tools has a global code action for this:

  1. Open the Command Palette
  2. Run “Add Tooltips to the Active Project”
  3. Confirm to run on all files

This adds a generic tooltip (“Specifies the value of the [field] field.”) to every page field that’s missing one. Erik acknowledges that these generic tooltips aren’t particularly useful on their own, but argues it’s much easier to go in and update existing tooltip text than to add the tooltip property from scratch every time. You can also use VS Code’s search functionality to find all instances of the generic text and update them systematically — in his demo, he found 42 places that needed personalized tooltip text.

Important Tip: Reload the Window After Global Operations

Erik shares an important side note about how the AL compiler works in the background. It constantly monitors file changes and tries to stay in sync. When you perform a global operation that modifies many files at once, the compiler can get confused — you might see red squiggly lines on code that is actually correct, or the error count might not update properly.

The fix is simple: after any global code action, run Developer: Reload Window from the Command Palette. This forces everything to resync, and you’ll see the accurate state of your project.

Sample AL Code for Context

For reference, here’s an example of a simple AL page extension. In older code, you’d often see field references and procedure calls without explicit qualifiers — exactly the kind of code that global code actions help modernize:

pageextension 50100 CustomerListExt extends "Customer List"
{
    trigger OnOpenPage();
    begin
        Message(GenerateAwesomeMessage(TODAY()));
    end;

    local procedure GenerateAwesomeMessage(T: Date): Text
    var
        d: Integer;
        m: Integer;
        y: Integer;
    begin
        d := 3;
        m := 4;
        y := 5;
        newProcedure(d, m);
    end;

    local procedure newProcedure(var d: Integer; var m: Integer): Text
    begin
        for d := m to m * 5 do begin
            for m := d to d * 5 do begin
                if d = m then
                    exit('Test!!!');
            end;
        end;
    end;
}

Summary

Global code actions in the AZ AL Dev Tools extension are a massive time-saver for Business Central developers. Whether you need to remove implicit with statements across 26,000 references or add tooltips to an entire project, these tools reduce hours of tedious manual work to mere seconds. Install the extension, learn the commands, and don’t forget to reload your window after running global operations. And if these tools save you time, Erik encourages you to send some love to Andrzej — let him know on Twitter that his tools are making a difference.