Can the new Bing Chat write AL?

I have been testing ChatGPT’s AL capabilities in a couple of recent videos. Now Microsoft is ready with Bing Chat. Since this one is connected to the internet, it should be more capable. Check out the video:

https://youtu.be/wQ_51MVaq_Q

In this video, Erik puts the new Bing Chat (Microsoft’s AI-powered search chat) to the test to see how well it can write and understand AL code for Business Central. Having previously tested ChatGPT in earlier videos, Erik compares the two experiences and finds that Bing Chat’s ability to pull information from the web gives it a notable advantage when working with AL code.

Bing Chat vs. ChatGPT: The Key Difference

The fundamental difference between ChatGPT and Bing Chat is that Bing Chat is connected to the web. When you ask it a question, it goes out and runs a search query, then incorporates the results into the conversation. ChatGPT, by contrast, is disconnected from the internet and relies solely on its training data.

Erik starts by asking a simple question: “Do you know the AL language?” Bing Chat confirms that it knows about the programming language for Microsoft 365 Business Central and provides links to relevant documentation — something ChatGPT simply cannot do.

Asking for AL Code Examples

When asked to show examples of AL code, Bing Chat pulls from Microsoft’s documentation, Roberto’s blog, the AL language GitHub repo, and other sources. It provides a case statement example along with reference links — a nice touch that helps verify the accuracy of the generated code.

Erik then asks: “How do I create a customer table in AL?” Bing Chat responds with a typical table extension example and even links to Steve’s blog. This is the kind of thing Erik had previously built manually. Here’s what a basic custom table looks like in AL:

table 50100 "Customers"
{
    DataClassification = ToBeClassified;

    fields
    {
        field(1; "No."; Code[20])
        {
            DataClassification = ToBeClassified;
        }
        field(2; "Name"; Text[100])
        {
            DataClassification = ToBeClassified;
        }
        field(3; "Address"; Text[100])
        {
            DataClassification = ToBeClassified;
        }
    }

    keys
    {
        key(PK; "No.")
        {
            Clustered = true;
        }
    }
}

Putting Fields on Pages

Following up, Erik asks how to put a field on a page. Bing Chat generates a correct example of adding a field to a customer list page, complete with links and follow-up questions. Here’s an example of what a list page looks like in the project:

page 50101 "Customers List"
{
    PageType = List;
    SourceTable = Customers;
    CardPageId = 50100;

    layout
    {
        area(Content)
        {
            repeater(Rec)
            {
                field("No."; Rec."No.")
                {
                    ApplicationArea = All;
                }
                field("Name"; Rec."Name")
                {
                    ApplicationArea = All;
                }
                field("Address"; Rec."Address")
                {
                    ApplicationArea = All;
                }
            }
        }
    }
}

And the corresponding card page:

page 50100 "Customers"
{
    PageType = Card;
    SourceTable = Customers;

    layout
    {
        area(Content)
        {
            group("Customer Information")
            {
                field("No."; Rec."No.")
                {
                    ApplicationArea = All;
                }
                field("Name"; Rec."Name")
                {
                    ApplicationArea = All;
                }
                field("Address"; Rec."Address")
                {
                    ApplicationArea = All;
                }
            }
        }
    }
}

The project also includes a page extension that adds an action to the standard Customer List:

pageextension 50101 "Customers List Action" extends "Customer List"
{
    actions
    {
        addlast(Processing)
        {
            action("View Card")
            {
                ApplicationArea = All;
                Promoted = true;
                PromotedCategory = Process;

                trigger OnAction()
                begin
                    Page.RunModal(Page::"Customers List");
                end;
            }
        }
    }
}

Documentation Generation: Better Than ChatGPT

Erik switches to a task he had previously tested with ChatGPT: generating documentation for an AL function. He pastes in a function that takes a JSON object and creates a record reference from it — iterating over keys, extracting field numbers, and assigning values.

Bing Chat produces documentation that Erik considers better than what ChatGPT generated. It correctly identifies that:

  • The procedure takes a JSON object and a record reference as parameters
  • It assigns values from the JSON object to corresponding fields in the record reference
  • The keys are field numbers prefixed with “f”
  • Values are JSON tokens
  • The procedure iterates over all keys, evaluates them as integers, gets field references, and uses a helper function called AssignValueToField
  • The procedure does not return any value

Erik is particularly impressed that Bing Chat identified the “f” prefix convention for field number keys, even though he’s not entirely sure where that pattern originated in his code.

Writing Test Cases

One of the suggested follow-up questions from Bing Chat is: “Can you write a test case for this function?” The generated test code has some issues — inline variables don’t work in AL the way Bing Chat suggests — but the overall structure and assertion logic is largely correct. Erik notes this is “pretty cool” for an AI-generated test.

Documenting Functions Without Source Code

In an especially interesting test, Erik asks Bing Chat to write documentation for the AssignValueToField helper function — without ever showing it the source code. Based purely on context from the earlier conversation, Bing Chat correctly infers that the function:

  • Takes a field reference and a JSON token as parameters
  • Assigns the value of the JSON token to the field reference based on its data type
  • Handles type conversion — for example, converting to string for text fields and to boolean for boolean fields

This ability to infer function behavior from context alone is remarkable.

Generating Reverse Functions

Erik pushes further by asking Bing Chat to write the opposite function — one that converts from a record reference to JSON. The result isn’t perfect AL code (it slips into patterns from other languages in places), but the logic is “surprisingly close.” It correctly identifies the need to iterate over fields, get field values, and assign them to a JSON object.

Where Are We on the Innovation Curve?

Erik reflects on the broader implications of this technology. He references the S-curve of technology adoption (sometimes called the technology S-curve or diffusion curve) — where innovation starts slowly, accelerates steeply, and then flattens as the technology matures. The question is: where are we on that curve with large language models?

His take is that we’re at the very beginning — “the tip of the iceberg.” These models are fundamentally just predicting the next word in a sequence, and yet they produce results that seem far more intelligent than that simple mechanism should allow. Erik speculates that perhaps this is closer to how our own brains work than we might think.

He acknowledges that yes, people can break these systems by feeding them adversarial inputs for hours on end, but the productive use cases are far more interesting and promising.

Conclusion

Bing Chat represents a clear step forward from ChatGPT for AL development tasks, primarily due to its web connectivity. It can pull from Microsoft’s documentation, community blogs, and GitHub repositories to produce more accurate and better-referenced responses. Its ability to generate documentation, write test cases, and even infer function behavior from context makes it a genuinely useful tool for Business Central developers. While the generated code isn’t always perfect — you’ll still need to review and fix syntax issues — the productivity boost is real and only going to improve.