Skip to main content

🚀 Exploring Vibe Coding with GitHub Copilot for Business Central.

Hi All,

In a recent #BCOpenDiscussion session, we delved into the fascinating concept of Vibe Coding—a new way of building software where developers collaborate with AI (like GitHub Copilot) to co-create solutions. 

The session covered practical setup, how AI understands context, and even touched on Microsoft's new Model Context Protocol (MCP) integration for enhanced learning.

Let’s break down the journey, step by step.

🔍 What is Vibe Coding?

Vibe Coding is all about working with AI—not just using it as a tool but treating it as a coding partner. It's about defining your coding standards, supplying the right context, and letting the AI guide and generate meaningful solutions.

As I explored more, I found that once you start feeding proper information—like design rules, naming conventions, and requirement documents—the output from Copilot becomes surprisingly accurate and helpful.



📝 Setting the Stage: The Use Case

A few weeks ago, Kamal from the community volunteered to prepare a design document. While we initially discussed one idea, he shared a requirement on a different (but still relevant) use case: “Implementing Dynamic Payment-Based Discounts in Business Central.”

We decided to use this real-world scenario to demonstrate how vibe coding works with GitHub Copilot in VS Code.

🧠 Step 1: Understanding GitHub Copilot Modes

When using Copilot in VS Code, there are three main modes to work with:

  1. Ask – Just like chatting with an AI assistant. You ask a question, it answers.

  2. Edit – Makes changes to a specific file based on your input.

  3. Agent – This is where the magic happens. It can understand context across files and even auto-execute tasks without continuous manual input.

For Vibe Coding, we focus heavily on the Agent Mode because it allows Copilot to analyze multiple inputs and files to build a project more holistically.

💻 Step 2: Creating a New Business Central Workspace

Inside VS Code, we tried the "Create new workspace with Copilot" feature. It walked us through:

  • Setting up a new AL project

  • Automatically generating app.json, default table, and page objects

  • Adding launch.json, tasks.json, and even a GitHub .gitignore

  • Checking for AL Language Extension

  • Setting up code analyzers and default dependencies

Note: It defaulted the target version to v19 and runtime to an older version. We manually updated it to match Business Central 26 (runtime 14.0) for relevance.

🧾 Step 3: Writing Copilot Instructions (copilot-instructions.md)

The core of vibe coding is setting the rules for your AI partner.

We created a copilot-instructions.md file to define our coding conventions:

  • Field prefix: SDH

  • Field captions: should not include the prefix

  • Dependencies: should include base and system apps

  • ApplicationArea: should be defined for UI elements

  • Naming rules, documentation standards, and more

You can customize this markdown document as much as you like. The key is to make it a living style guide for your AL projects.

📄 Step 4: Adding a Functional Requirement Document

We took Kamal’s use case on Dynamic Payment-Based Discounts and converted it into a .md format to add as a functional requirement doc.

You can use online converters or manually format the document in markdown. This document helps Copilot understand what functionality it’s expected to build.

🌐 Step 5: Integrating Microsoft Learn MCP

Microsoft recently introduced Model Context Protocol (MCP) support via Microsoft Learn. This allows AI tools like Copilot to:

  • Use Microsoft’s official documentation as part of their knowledge base

  • Generate more context-aware, standards-compliant AL code

To integrate MCP in VS Code:

  1. Run MCP: Add Server from the Command Palette

  2. Use the endpoint: https://learn.microsoft.com/api/mcp

  3. Choose to connect globally or just for this workspace

This adds a mcp.json file in your project and enables AI to access Microsoft Learn content directly.

🧠 Step 6: Providing Context Before You Code

With everything in place, here’s how you set up the context for Copilot Agent:

  • Select your model

  • Choose Agent Mode

  • Add context sources:

    • ✅ Instruction File (copilot-instructions.md)

    • ✅ Requirement Document (discount-feature.md)

    • ✅ MCP Integration

    • Optionally add:

      • Project files

      • Symbols

      • Screenshots (for UI guidance)

Once done, Copilot starts analyzing your workspace and begins drafting solutions.

🔄 What’s Next?

The setup now allows Copilot to generate Business Central AL code tailored to your company’s standards and functional requirements. In upcoming sessions, we’ll dive deeper into:

  • Auto-generating test cases

  • Using screenshots as design context

  • Real-time code reviews by Copilot

  • Versioning and documenting via AI

👨‍💻 Final Thoughts

Vibe Coding isn't just a trend—it’s a paradigm shift. By combining human intent with AI execution, we're unlocking new productivity levels for Business Central developers. As this ecosystem evolves, expect more seamless integrations between tooling, documentation, and AI.

If you haven't tried this yet, now is a great time to start. All you need is:

  • VS Code

  • GitHub Copilot

  • AL Language Extension

  • A clear set of rules and requirements

Let the AI handle the boilerplate, and you focus on the business logic.

💬 Join the Discussion

Have thoughts or want to try this in your own team? Join our Teams Community: Saurav’s Dynamic Hub and be part of the #BCOpenDiscussion every Friday!

Happy Coding!
Saurav Dhyani
Founder, Edhate Consulting
YouTube: Saurav Dhyani - Business Central

Comments

Popular posts from this blog

RTC Report It is not possible to instantiate the Visual Studio bridge.

Hi all, As a Navision developers I have Multiple Versions of Navision running in single Machine. As discussed Earlier in the post how to run multiple Version of RTC in single machine. So my machine have following details for RTC Versions - NAV 2009 R2    - is installed. NAV 2009 SP1  - is copied at C:\Program Files (x86)\Microsoft Dynamics NAV\60\NAV 6.0 SP1 IN\ NAV 2009         - is copied at C:\Program Files (x86)\Microsoft Dynamics NAV\60\NAV 6.0 IN\ This approach has been working great for execution of Classic and RTC Clients. However, after installing Dynamics NAV 2009 R2, if i tried to view the Layout for an NAV 2009 SP1 Report i was getting the following error: ---------------------------  Microsoft Dynamics NAV Classic  ---------------------------  It is not possible to instantiate  the Visual Studio bridge.  ---------------------------  OK    --------------------------- After searchi...

Dynamics NAV - All that you need to know about MenuSuites.

Hi Readers, This article is based on a request from a blog reader who wanted to understand about MenuSuite in Dynamics NAV. If you have started working with Business central with AL Code then it does not apply to those releases but if you are interested go ahead. Let's start with Future - In Latest and greatest version of product MenuSuite are obsolete and no longer used. So this article applies if you want to learn about C/AL MenuSuite.

How to Set Up NavUserPassword Authentication in Business Central.

Hi Readers, In this article we will discuss steps to Setup NAVUserPassword in Business Central on-prem. NavUserPassword is an authentication method that's handled by Business Central Server, but isn't based on Windows users or Active Directory. Each user is set up with a username and password that's configured inside Business Central only. The user is prompted for username/password credentials when they start the client. #msdyn365bc, #credentialtype