🚀 Copilot and AL Development: Transforming the Future of Business Central Engineering

The world of Business Central development is evolving rapidly—and one of the most powerful accelerators in recent years is Copilot. With AI deeply integrated into the Microsoft ecosystem, developers building extensions with AL now have an intelligent partner that speeds up development, enhances accuracy, and improves productivity.

🧠 What Is Copilot in Business Central?

Copilot is Microsoft’s AI-powered assistant designed to help developers, consultants, and end-users across Dynamics 365. For Business Central development, Copilot works in multiple ways:

  • Suggesting AL code in VS Code
  • Generating complete extension structures (tables, pages, APIs, codeunits)
  • Helping analyze and explain existing AL code
  • Creating documentation and comments automatically
  • Supporting AI-enabled scenarios inside BC

It acts like a smart co-developer—always ready, always fast.

💻 Copilot Inside AL Development (VS Code Integration)

To leverage Copilot for AL development, developers use the GitHub Copilot extension in Visual Studio Code. This integration enables:

✔ Instant AL Code Generation

Developers can write a comment or a simple description, and Copilot generates the AL code structure automatically.

Example:

// Create a sales quote scheduler job that sends reminders 

Copilot produces the full codeunit, job logic, and scheduling pattern.

✔ Faster Page & Table Extensions

Copilot instantly creates field additions, actions, triggers, and layouts without manual typing.

✔ API & Permission Set Generation

Perfect for rapid prototyping.

🤖 Using AI Inside AL Extensions

You can integrate AI into your custom extensions using Copilot-enabled system codeunits or external AI services.

Example: A simple AI-driven item description generator:

codeunit 50100 "Item AI Description"
{
    procedure Generate(ItemRec: Record Item): Text
    var
        Copilot: Codeunit "Copilot System";
    begin
        exit(
            Copilot.GenerateText(
                'Create a professional marketing description for item: ' + ItemRec.Description
            )
        );
    end;
} 

This allows users to generate product descriptions instantly saving hours of manual work.

⚡ How Copilot Improves AL Developer Productivity

🟦 1. Rapid Coding

Copilot reduces 60–70% of repetitive development effort.

🟦 2. Fewer Syntax Errors

Copilot understands AL structures and suggests correct patterns.

🟦 3. Code Understanding

It can analyze and explain legacy AL code—very useful during upgrades from NAV to BC.

🟦 4. Documentation

Automatically generates comments and XML documentation.

🟦 5. Code Quality

Copilot suggests modern patterns like interfaces, single-responsibility design, and event-driven architecture.

🚨 Limitations—What Developers Should Know

Despite its strengths, Copilot is not perfect:

  • It may generate outdated syntax or patterns.
  • It cannot validate AL compiler rules.
  • It sometimes repeats code blocks unnecessarily.
  • Developers must always review and refactor generated output.

Copilot is a booster, not a replacement for AL expertise.

Copilot is not just a trend—it’s a game changer for Business Central developers. It speeds up AL development, supports learning, and enhances overall code quality. By embracing Copilot, organizations can deliver extensions faster, reduce development cost, and empower developers to focus on business logic rather than repetitive tasks.

The future of Business Central development is AI-assisted, and Copilot is leading the way.

Stay Tuned for more…

🧩Fixing “Missing appid on table extension metadata” Error in Business Central

Recently while running a tenant synchronization in Microsoft Dynamics 365 Business Central (on-prem), I encountered an error during the Sync-NAVTenant process:

This error typically occurs during tenant synchronization and can halt your deployment or upgrade process. The issue stems from corrupted or incomplete metadata in the app schema snapshot table, specifically related to table extensions.

The error indicates that the $ndo$navappschemasnapshot system table contains table extension records that are missing the required appid field. This can happen due to:

  • Incomplete app installations or uninstallations
  • Failed upgrade processes
  • Database corruption during extension deployment
  • Manual modifications to extensions without proper cleanup.

The Solution

The fix involves cleaning up the corrupted table extension metadata from the schema snapshot table. Here’s the SQL query that resolves the issue:

USE [YourDatabaseName]
GO

DELETE FROM [$ndo$navappschemasnapshot] 
WHERE (istableextension = 1)
GO

4. Start the Service and Sync

Restart the service and perform the tenant sync:

Use Powershell

Start-NAVServerInstance -ServerInstance YourInstanceName
Sync-NAVTenant -ServerInstance YourInstanceName -Mode Sync

The “Missing appid on table extension metadata” error can be frustrating, but it’s usually straightforward to resolve with the SQL cleanup approach. Remember to always backup your database before making direct SQL modifications and test the solution in a non-production environment first.

If you face a similar issue during tenant sync or app upgrade, this SQL cleanup should help you recover quickly.

💡 Should Consultants Use Vibe Coding in Business Central?

The rise of AI-powered coding assistants has sparked a fascinating shift in the consulting world. Functional consultants, traditionally focused on business processes and requirements, are now picking up coding tools and creating technical solutions themselves. This phenomenon, often called “vibe coding,” is reshaping team dynamics and project workflows. But is this evolution beneficial, or does it create new challenges?

What is Vibe Coding?

Vibe coding refers to the practice of using AI assistants like GitHub Copilot, ChatGPT, or Claude to write code based on natural language descriptions and high-level understanding, rather than deep technical expertise. For functional consultants who understand business requirements intimately but lack extensive programming experience, these tools offer a tempting shortcut to implementation.

Why Functional Consultants Are Embracing Code ?

1. Faster Solution Delivery

Consultants can quickly generate AL code snippets, table extensions, or API wrappers using natural language prompts. What might take hours of manual coding can be drafted in minutes. This speed is particularly useful in sandbox or prototyping phases.

2. Empowered Functional Consultants

Functional consultants, who understand business processes but may lack deep AL knowledge, can experiment with configurations or customizations. This bridges the gap between functional understanding and technical execution, leading to better collaboration.

3. Lower Entry Barrier for New Developers

For junior technical consultants, Vibe Coding serves as a teaching companion. It can suggest syntax, help avoid errors, and guide them through standard Business Central development patterns.

4. Consistency and Standardization

AI-driven code suggestions can align to best practices and Microsoft guidelines (if the tool is properly trained), ensuring consistent code quality across teams.

⚠️ The Drawbacks and Risks

1. Uncontrolled Code Generation

AI tools can produce functional code that appears correct but lacks performance optimization or security validation. If used directly in production environments, this can lead to instability or compliance issues.

2. Reduced Technical Ownership

Overreliance on Vibe Coding may cause consultants to skip the learning curve of understanding Business Central’s architecture, data model, or event-driven patterns. This can erode long-term technical expertise.

3. Audit and Governance Challenges

AI-generated code might not have clear authorship or documentation. In regulated industries, this creates challenges during audits or code reviews, especially if traceability is required.

4. Data Security Concerns

If the tool transmits prompts or metadata to external servers for AI processing, it could expose sensitive business logic or schema information. This must be reviewed against company data protection policies.

👨💻 Impact on Technical Consultants

Vibe Coding doesn’t replace technical consultants — but it changes their role:

  • From coders to reviewers: Technical consultants become code reviewers and architects ensuring AI-generated outputs follow best practices.
  • From builders to enablers: They enable functional teams by setting up safe guardrails, templates, and review processes.
  • From developers to strategists: With repetitive tasks automated, technical consultants can focus on design, integration, and performance tuning.

In essence, Vibe Coding shifts technical consulting toward higher-value work, provided governance and quality checks exist.

Vibe Coding represents a powerful step toward modernizing Business Central development. It can improve efficiency, empower functional teams, and streamline solution delivery — but only when implemented with strong governance, code review, and data protection policies.

Rather than diminishing the role of technical consultants, Vibe Coding highlights their importance. They become the architects and quality guardians who ensure that AI-generated work aligns with business goals, technical standards, and long-term sustainability.

What do you think on this ?

Protecting Sensitive Data Made Easier: Introducing ‘Concealed’ Text Field Type in Business Central Wave 2 2025

Data privacy and security have become paramount concerns for businesses across all industries. With increasing regulatory requirements and growing awareness of data protection, organizations need robust yet user-friendly solutions to safeguard sensitive information. Microsoft’s Dynamics 365 Business Central Wave 2 2025 introduces a game-changing feature that addresses this challenge: the new ‘Concealed’ text field type with the innovative Mask Type property.

The Challenge: Balancing Security and Usability

Traditionally, we faced a dilemma when handling sensitive data fields. The existing ExtendedDataType = Masked property offered security by displaying field values as dots, but this approach had limitations:

  • Always hidden: Once masked, the data remained permanently concealed, even from authorized users
  • Poor user experience: Users couldn’t verify entered data, leading to potential input errors
  • Limited flexibility: No option to reveal data when legitimate access was needed

These limitations created friction between security requirements and practical usability, forcing developers to choose between protecting sensitive data and maintaining a smooth user experience.

Business Central Wave 2 2025 introduces the new MaskType enum property, revolutionizing how we handle sensitive data display. This property offers two distinct values:

MaskType Values Explained

None (Default)

  • Standard behavior where field values are fully visible in the UI
  • No masking or concealment applied
  • Suitable for non-sensitive data fields

Concealed

  • Field values are hidden by default, appearing as masked dots
  • Users can reveal the actual value through an explicit action
  • An interactive “eye” button appears next to the field for toggling visibility
  • Perfect balance between security and accessibility

Implementing the concealed field type is straightforward. Here’s how to configure it in your AL code:

field(50100; "Sensitive Data"; Text[100])
{
    Caption = 'Sensitive Information';
    MaskType = Concealed;
}

When rendered in the UI, this field will display:

  • Masked dots by default (●●●●●●●●)
  • An eye icon button for revealing/concealing the value
  • Smooth toggle animation between hidden and visible states

Supported Field Types

The MaskType = Concealed property works with:

  • Text fields: For sensitive textual information
  • Code fields: For confidential codes and identifiers
  • Decimal fields: For sensitive numeric values with decimals
  • Integer fields: For confidential whole numbers

Supported Page Types

The concealed functionality is available on:

  • Document pages: Sales orders, purchase orders, etc.
  • Card pages: Customer cards, vendor cards, item cards
  • Not supported: List page repeaters and grid controls

The introduction of the ‘Concealed’ text field type with the MaskType property in Business Central Wave 2 2025 represents a significant advancement in data protection capabilities. This feature successfully bridges the gap between security requirements and user experience, providing organizations with a flexible, user-friendly approach to protecting sensitive information.

Stay tuned for more.

Vibe Coding in AL Development for Business Central

As AL developers working with Microsoft Dynamics 365 Business Central, we often find ourselves caught between strict business requirements and the desire to write code that feels good, but with the latest Vibe Coding experience, we can see how developers interact with the platform. Instead of writing everything manually, Vibe Coding leverages AI-driven assistance, contextual suggestions, and natural language inputs to speed up solution building.

Vibe Coding isn’t just about writing code—it’s about creating a harmonious development experience that reduces cognitive load, enhances creativity, and produces more maintainable, scalable AL solutions. It combines best practices from agile development, clean code principles, and user experience design to create a holistic approach to Business Central customization.

What is Vibe Coding?

Vibe Coding is Microsoft’s new AI-assisted development experience embedded in Business Central AL development. Think of it as a “copilot for AL” — it understands your context, suggests code snippets, and helps you scaffold solutions quickly.

With Vibe Coding, you can:

  • Generate AL objects (tables, pages, code units) using natural language prompts.
  • Get inline suggestions for methods, triggers, and patterns.
  • Reduce boilerplate coding and focus on solution logic.
  • Learn AL development faster if you’re new to the ecosystem.

Getting Started

To enable Vibe Coding in AL development:

  1. Update your AL extension in Visual Studio Code to the latest version (available in VS Code Marketplace).
  2. Ensure your Business Central environment is updated to fully support Vibe Coding.
  3. Ensure Copilot features are enabled.
  4. Open your AL project and start coding — the AI suggestions will appear as ghost text or through the command palette.
Article content

Example: Creating a Table with Vibe Coding

Traditionally, you create a table object like this:

table 50100 "Customer Ledger Extension"
{
   
    fields
    {
        field(1; "Customer No."; Code[20])
        {
            DataClassification = CustomerContent;
        }

        field(2; "Ledger Balance"; Decimal)
        {
            DataClassification = CustomerContent;
        }
    }
}

With Vibe Coding, you could simply type in natural language:

“Create a table for Customer Ledger with Customer No. and Ledger Balance fields.”

And Vibe Coding will generate the AL code for you, ready to refine.

Example: Extending a Page

Say you want to extend the Customer Card page to show the new field. Instead of looking up the object ID and syntax, you could type:

“Extend Customer Card to add Ledger Balance field from Customer Ledger Extension table.”

The tool generates the boilerplate page extension code, leaving you to adjust anything you requires.

The Future of AL Development

Vibe Coding works brilliantly for proof-of-concepts and small team innovations. The sweet spot? 👉 Start with Vibe for rapid progress, then formalize as the codebase matures.

For AppSource apps and enterprise BC implementations, structured development still wins. But for exploring new features or quick client customizations? Vibe Coding can be your secret weapon.

It’s not here to replace developers — it’s here to supercharge productivity and free us to focus on innovation. 🚀

Stay tuned for more as it is still in learning phase.

Boosting Performance in Business Central with SETLOADFIELDS

When building customizations or integrations in Microsoft Dynamics 365 Business Central, performance is often a key concern—especially when working with large datasets. One powerful tool for improving performance is the SETLOADFIELDS method on record variables.

🚀 What is SETLOADFIELDS?

In Business Central, when you retrieve a record (using FIND, GET, NEXT, etc.), all fields of the record are loaded from the database by default. This includes fields you might never use, such as FlowFields (which are calculated on the fly). This can lead to unnecessary memory usage and slower data retrieval.

SETLOADFIELDS tells the system which fields to load, so it skips the rest. This can dramatically improve performance, particularly when:

  • You’re looping through large datasets
  • You’re only using a few fields per record
  • Your table includes FlowFields or BLOBs

📘 Syntax

Rec.SETLOADFIELDS(Field1, Field2, ...);

You place this line before reading the records. This tells the AL runtime engine to load only the specified fields when the records are retrieved.

Let’s say you need to loop through all items and check their No. and Inventory:

Item.SETLOADFIELDS("No.", Inventory);
if Item.FINDFIRST then
  repeat
    if Item.Inventory > 0 then
      // do something
  until Item.NEXT = 0;

  1. Use SETLOADFIELDS only when needed – Overusing it without understanding the data flow may result in missing fields or unexpected behavior.
  2. Calling CALCFIELDS still works – You can still explicitly calculate FlowFields after using SETLOADFIELDS.
  3. Resets on modification – If you call MODIFY, INSERT, or VALIDATE, the load fields context is reset. Use SETLOADFIELDS again if necessary.
  4. BLOB and FlowFields – Avoid loading BLOBs and FlowFields unless absolutely necessary. SETLOADFIELDS helps you skip them efficiently.

👨‍💻 Summary

FeatureWithout SETLOADFIELDSWith SETLOADFIELDS
Data LoadedAll fieldsOnly specified fields
Memory UsageHighLower
SpeedSlowerFaster

By leveraging SETLOADFIELDS, developers can significantly optimize the performance of their AL code in Business Central. It’s a small addition that can make a big difference in speed and scalability.

Avoid it when doing full record operations like MODIFY, unless you’re confident about which fields are required.

Stay Tuned for more…

Understanding GETRANGEMIN() and GETRANGEMAX() in Business Central

When working with filters and record ranges in AL , two handy functions often come into play: GETRANGEMIN() and GETRANGEMAX(). These functions help you programmatically access the lower and upper bounds of a filter applied to a field in a record. This can be especially useful for creating reports, processing data, or passing filters between records.

What are GETRANGEMIN() and GETRANGEMAX()?

These two functions are part of the Record data type and help retrieve the range boundaries for a specific field filter.

  • GETRANGEMIN(Field): Returns the lowest value in the filter range for the specified field.
  • GETRANGEMAX(Field): Returns the highest value in the filter range for the specified field.

If there is no filter set for the field, both functions return blank.

SalesHeader.SETFILTER("No.", '1000..2000');

MinNo := SalesHeader.GETRANGEMIN("No."); // Returns '1000'
MaxNo := SalesHeader.GETRANGEMAX("No."); // Returns '2000'

Use Cases

1. Transferring Filter Ranges

If you’re applying a filter on one table and want to use the same range on another:

Customer.SETFILTER("No.", 'C00010..C00020');
SalesHeader.SETRANGE("Sell-to Customer No.", Customer.GETRANGEMIN("No."), Customer.GETRANGEMAX("No."));

2. Generating Custom Reports

SalesHeader.SETFILTER("Posting Date", '2024-01-01..2024-01-31');

StartDate := SalesHeader.GETRANGEMIN("Posting Date");
EndDate := SalesHeader.GETRANGEMAX("Posting Date");

MESSAGE('Report for: %1 to %2', StartDate, EndDate);

3. Validating Filtered Data

IF (SalesHeader.GETRANGEMIN("Posting Date") < AllowedStartDate) OR
   (SalesHeader.GETRANGEMAX("Posting Date") > AllowedEndDate) THEN
    ERROR('Filter range is outside allowed period.');

The GETRANGEMIN() and GETRANGEMAX() functions are powerful tools when working with dynamic filters in AL. They enable developers to write cleaner, more adaptable code by directly accessing the boundaries of filter conditions.

Stay Tuned for more updates.

Boosting Performance in Business Central with SetAutoCalcFields

In today’s fast-paced business environments, performance optimization is not a luxury — it’s a necessity. Whether you’re building custom reports, extending pages, or writing integration APIs in Microsoft Dynamics 365 Business Central, slow operations can frustrate users and strain resources.

One simple but powerful technique to improve performance is using the SetAutoCalcFields method.

Why FlowFields Matter for Performance

In Business Central, FlowFields are virtual fields calculated on the fly, not stored physically in the database. Examples include:

  • Inventory on Item
  • Balance on Customer

When you retrieve a record, FlowFields are not calculated automatically unless you explicitly call CalcFields().

Manually calculating FlowFields for every record during loops, leading to multiple SQL queries — one for each record — causing heavy load and slower performance.

SetAutoCalcFields solves this by batch-calculating FlowFields along with the record fetch.
Instead of running one query per record, it combines the calculation in a single optimized query.

Imagine fetching 1,000 customers and displaying their balances without SetAutoCalcfields:

CustomerRec.FindSet();
repeat
    CustomerRec.CalcFields(CustomerRec.Balance); // Triggers a DB call every time!
    DisplayBalance(CustomerRec."No.", CustomerRec.Balance);
until CustomerRec.Next() = 0;

Result:
  • 1 SQL query to get Customers
  • + 1,000 SQL queries for Balances

With SetAutoCalcFields:

CustomerRec.SetAutoCalcFields(CustomerRec.Balance);
CustomerRec.FindSet();
repeat
    DisplayBalance(CustomerRec."No.", CustomerRec.Balance);
until CustomerRec.Next() = 0;

Result:
  • 1 SQL query to get Customers and Balances together

Benefits of Using SetAutoCalcFields

  • Improved Page Load Times: By deferring calculations, pages with numerous records and calculated fields will load significantly faster.
  • Faster Report Generation: Reports that rely on calculated fields will be generated more quickly as the calculations are performed only when the field’s value is actually needed for display or processing.
  • Reduced Database Load: Fewer automatic calculations translate to fewer database queries, reducing the overall load on your Business Central database.
  • Enhanced User Experience: Snappier performance leads to a more responsive and enjoyable user experience.

Best Practices for Performance Gains

To maximize the benefits of SetAutoCalcFields:

  • Only specify necessary FlowFields:
    Don’t auto-calculate every FlowField — focus on what your process needs.
  • Use it before data retrieval:
    Call SetAutoCalcFields before FindSet(), FindFirst(), or FindLast()
  • Avoid unnecessary recalculations:
    Once FlowFields are set to auto-calculate, do not manually call CalcFields() again for the same fields.
  • Monitor heavy FlowFields:
    Some FlowFields (e.g., Inventory) involve complex sums across tables — only auto-calculate when really needed.
  • Profile your code:
    Use Performance Profiler to measure improvements.

Using SetAutoCalcFields properly can lead to dramatic performance improvements in Business Central.
By reducing SQL traffic, simplifying code, and batch-fetching FlowFields intelligently, you can create faster, cleaner, and more scalable applications.

A small change in your coding habits can create a big impact for your users.

Hope this will help..

FieldRef.IsOptimizedForTextSearch() Method in Business Central 2025 Wave 1

With the release of Business Central 2025 Wave 1, Microsoft continues to empower developers with more control and insights into the performance and behavior of their extensions. Among the new additions is the method FieldRef.IsOptimizedForTextSearch(), designed to help developers make more performance-conscious decisions when implementing search functionalities.

💡 What is FieldRef.IsOptimizedForTextSearch()?

FieldRef.IsOptimizedForTextSearch() is a method that returns a Boolean value indicating whether a particular field in a table is optimized for text search.

It is a method on the FieldRef data type, which is used in AL code to dynamically refer to fields of records, especially in scenarios involving field iteration, metadata handling, or dynamic filters.

✅ Syntax:

Boolean := FieldRef.IsOptimizedForTextSearch();

⚙️ How to Optimize a Field for Text Search

While IsOptimizedForTextSearch() only checks if a field is optimized, setting it up is done via the table metadata or through the table schema in AL.

To mark a field for text search:

field(10; Description; Text[100])
{
Caption = 'Description';
DataClassification = ToBeClassified;
OptimizeForTextSearch = true;
}

Setting OptimizeForTextSearch = true; enables text search optimization (depending on SQL backend settings as well for on-premise).

Lets see how we can utlize above method to check optimize search

var
    MyRecordRef: RecordRef;
    MyFieldRef: FieldRef;
    IsOptimized: Boolean;
begin
    MyRecordRef.Open(Database::Customer);
    if MyRecordRef.FindSet() then begin
        MyFieldRef := MyRecordRef.Field(Name); // Let's check the "Name" field
        IsOptimized := MyFieldRef.IsOptimizedForTextSearch();

        if IsOptimized then
            Message('The "%1" field in the Customer table is optimized for text search.', MyFieldRef.Name())
        else
            Message('The "%1" field in the Customer table is NOT optimized for text search.', MyFieldRef.Name());
    end;
    MyRecordRef.Close();
end;

To be optimized for full-text search, a field typically needs:

  • A Text or Code data type.
  • An active index that supports full-text search (defined in the table metadata or via table extensions).
  • Proper settings in SQL Server or Azure SQL (if full-text search is enabled).

The FieldRef.IsOptimizedForTextSearch() method is a small but powerful tool in the AL developer’s toolkit. Whether you’re designing smarter search UIs or optimizing performance in large datasets, this method gives you the metadata visibility to make informed choices.

By leveraging this feature, you can:

  • Improve app performance
  • Avoid slow queries
  • Create better user experiences

Stay tuned for more..

Generate launch.json from the Web Client in Business Central – Wave 1 2025

With the 2025 Wave 1 release of Microsoft Dynamics 365 Business Central, developers get a significant productivity boost: the ability to generate a launch.json file directly from the Web Client! 🎉 This is a feature that eliminates the need to manually configure environment settings in Visual Studio Code (VS Code), especially useful when working across multiple environments or containers.

💡 What is launch.json?

In AL development for Business Central, the launch.json file defines how your AL project connects to your Business Central environment. It includes settings like:

{
  "name": "Your Environment",
  "type": "al",
  "request": "launch",
  "server": "https://your-environment-url",
  "serverInstance": "BC",
  "authentication": "UserPassword",
  "tenant": "your-tenant-id"
}

You can now generate the launch.json configuration directly from the Web Client using just a few clicks. No more copying URLs, figuring out authentication types, or guessing server details.

🔧 Steps to Generate:

  1. Log into your Business Central Web Client.
  2. Navigate to the Help & Support page (? page=134).
  3. Scroll down to the Troubleshooting section.
  4. Look for the new Download launch.json button (or similar option).
  5. Click it – a launch.json file will be downloaded, pre-filled with your current environment’s configuration.

Second option will be navigate Installed extensions and download launch.json

The introduction of the launch.json generation feature in the Business Central Wave 1 2025 web client is a welcome addition for AL developers. It promises to streamline the initial setup process, reduce configuration errors, and enhance overall development efficiency.

Stay tuned fore more.