web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :

Boost Business Central Development with GitHub Copilot: Tips & Prompt Strategies

Dr Gomathi MVP, MCT Community lead, MLE Profile Picture Dr Gomathi MVP, MCT... 340 Super User 2025 Season 2

Introduction

As a Business Central developer, you're always looking for ways to develop more efficiently without compromising quality. Copilot can certainly help in that regard, providing its suggestions are applied judiciously. This guide will teach you how to maximize Copilot's potential in your Business Central workflow, with strategic prompts and a balanced development approach. We'll recap what Copilot is, explore how it can streamline tasks like coding boilerplate or automating tests, and discuss effective prompting techniques.

What is GitHub Copilot? (Quick Recap)

GitHub Copilot is an AI coding assistant developed by GitHub and powered by OpenAI. It helps you write code by suggesting lines, functions, or even entire files based on comments or your current code. For Business Central developers working with AL (Application Language), it can:
  • Generate boilerplate code for tables, pages, and reports
  • Suggest syntax corrections
  • Help automate testing scenarios
  • Speed up extension development


Why Use GitHub Copilot for Business Central?

Here’s how it can change the way you work:
  • Save time on repetitive patterns
  • Improve accuracy in syntax and object structure
  • Learn by example through generated suggestions
  • Speed up onboarding for new developers

Effective Prompt Strategies for AL Development

To get the most out of Copilot, the way you write prompts matters. Below are practical prompt examples you can use

1. Comment-Driven Prompting
Before writing code, write a clear comment. For example:
// Create a customer list page with name, number, and balance

Copilot will generate the full page structure with standard properties and actions.

 2. Use Object Type Keywords
Start with object keywords to trigger relevant code:
table 50100 "Custom Table"
Copilot will suggest a full table scaffold, including primary keys and sample fields.
 3. Describe Test Scenarios
Copilot is also helpful in generating test codeunits:
// Test: Validate that customer balance is updated after posting a sales invoice

It can suggest the entire test case setup, including mocks and asserts.
 4. Extend Existing Objects
Need to add a field to the Customer card?
// Add a "Preferred Contact Method" field to Customer card
It will help generate the pageextension or tableextension block for you.

Pro Tips to Get Better Copilot Results

Here’s how to work smarter with Copilot:
  1. Use meaningful comments: The more specific your comment, the better the code.
  2. Accept and refine: Copilot gives a starting point. Always review and adjust the output.
  3. Keep your code clean: The cleaner your base code, the more relevant the suggestions.
  4. Use keyboard shortcuts:
    • Tab: Accept suggestion
    • Ctrl + Space: Trigger suggestions manually
  5. Avoid over-reliance: Let it assist—not replace—your critical thinking.

Real-World Use Cases

Scenario 1: Need to create a Purchase Order page?
Write:
// Create a Purchase Order list page for vendors with totals and filters

Scenario 2: Writing permission sets for a new module?
Prompt:
// Define a permission set for Custom Sales Users with read access to Customer and Sales Header

Copilot will propose the correct object IDs and operations.

Is It Safe to Use?
Copilot is a secure tool, but you should follow best practices:

  • Don’t expose sensitive business logic in prompts
  • Review Copilot suggestions before committing
  • Keep your extensions aligned with Microsoft's AL coding guidelines


Final Thoughts

GitHub Copilot won’t replace your role as a Business Central developer—but it will make you faster and more efficient. By mastering prompt strategies and adopting AI-assisted workflows, you’re future-proofing your development process. So go ahead—experiment, iterate, and let Copilot handle the boilerplate while you focus on building better solutions.


Have You Tried These Prompts Yet?
Leave a comment or share your favorite prompt in the community. Let’s learn together and boost our Business Central development to the next level.


    Comments