In the previous post, I introduced GitHub Copilot in Visual Studio Code and the different modes it offers for AL development. Once you start using Copilot more actively, one question comes up very quickly:

When should I use Chat, Ask, or Edit?

At first, these modes look similar. They all work with code and they all generate text.
In practice, they serve very different purposes. Using the wrong one is often why Copilot feels unreliable or inconsistent.

The easiest way to explain the difference is to take one small AL problem and approach it three times — once with each mode.


A Small but Typical AL Scenario

Assume you are extending the Customer table with a Loyalty Score field.

The requirements are simple:

  • The value must be between 0 and 100

  • Validation logic should be easy to read

  • Business logic should not live in the page

  • The solution should be easy to adapt later

This is not a special case. Most AL developers have implemented something similar many times.


Using Copilot Chat

Designing a solution

Copilot Chat is most useful when you are still thinking about structure.

At this point, you are not fixing code yet. You are deciding how the solution should look.

Prompt:

Create an AL solution for a Customer Loyalty Score field with validation between 0 and 100.
Keep the structure clean and avoid putting business logic in the page.

This prompt is intentionally high level. It does not reference existing code.
It asks for a solution, not a rewrite.

Copilot Chat typically responds with an approach rather than a single code snippet.

What it usually does well:

  • Proposes a complete setup

  • Suggests where validation or business logic belongs

  • Introduces additional objects if that makes sense

  • Explains design choices briefly

A typical answer includes:

  • A table extension with validation

  • A codeunit that owns the business logic

  • Consistent naming


Copilot Chat proposing a structured AL solution instead of a single code snippet.

Think of Chat as a sparring partner while designing.


Using Copilot Ask

Understanding existing code

Now assume the code already exists.

You select the following validation logic:

trigger OnValidate()
begin
if LoyaltyScore < 0 then
Error('Invalid value');
if LoyaltyScore > 100 then
Error('Invalid value');
end;

You are not ready to change anything yet.
You simply want to understand what the code does and whether it is any good.

Ask prompt:

Explain what this validation does and point out possible issues.

Copilot Ask stays close to the selected code.
It explains, but it does not redesign.

Typical feedback from Ask includes:

  • A clear explanation of the validation logic

  • A remark about duplicated conditions

  • A note about the vague error message

  • A suggestion that the logic could be simplified


Copilot Ask explaining selected validation code in plain language.

Ask behaves very much like a code review assistant.


Using Copilot Edit

Improving code

Once the intent and the problems are clear, it is time to improve the code.

Select the same block of code and choose Edit with Copilot.

Edit instruction:

Refactor this validation to be cleaner and improve the error message.

Copilot Edit proposes a concrete change to the selected code only.

A typical result looks like this:

trigger OnValidate()
begin
if (LoyaltyScore < 0) or (LoyaltyScore > 100) then
Error('Loyalty Score must be between 0 and 100.');
end;

What Edit is good at:

  • Producing a focused rewrite

  • Preserving context and naming

  • Generating usable AL immediately

  • Letting you accept or reject the change


Copilot Edit proposing a focused refactoring of the selected validation logic.

Edit is the most precise of the three modes.


Same Code, Different Intent

All three modes work with the same AL code.
The difference is intent.

Mode Typical use
Chat Designing or restructuring
Ask Understanding and reviewing
Edit Refactoring and improving

They complement each other. They are not interchangeable.


A Common Source of Frustration

A frequent mistake is using Chat for everything.

Chat can explain code. It can refactor code.
That does not mean it should.

  • Want to understand code → Ask

  • Want to change code → Edit

  • Want to think about structure → Chat

Once this distinction is clear, Copilot becomes far more predictable.


About Copilot Agent

Copilot Agent is deliberately left out of this comparison.

Chat, Ask, and Edit all operate at a very local level, which makes them easy to compare side by side.
Agent works across files and objects and deserves a separate discussion.


Closing Thoughts

Chat, Ask, and Edit are not three ways of doing the same thing.


They support different phases of development:

  • Chat helps you think

  • Ask helps you understand

  • Edit helps you improve

Used intentionally, Copilot feels less like a novelty and more like a natural extension of Visual Studio Code.

In the next post, I will take a closer look at Copilot Agent.

Agent works at a very different level than Chat, Ask, and Edit. Used well, it can save time. Used at the wrong moment, it often does the opposite.

Understanding when Agent makes sense — and when it doesn’t — is the next step in using Copilot effectively in AL development.


Discover more from think about IT

Subscribe to get the latest posts sent to your email.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Post Navigation