GitHub Copilot is Microsoft’s AI-powered coding assistant that provides real-time code suggestions directly in your editor. It’s trained on billions of lines of public code and integrates seamlessly with Visual Studio Code.
Developer: GitHub (Microsoft)
Type: AI Code Completion Agent
Primary Use: Inline code suggestions as you type
Integration: Native VS Code extension
GitHub Copilot acts as an AI pair programmer that:
Example:
// Type this comment:
/// Calculate total sales for customer including tax
// Copilot suggests (press Tab to accept):
procedure CalculateTotalSalesWithTax(CustomerNo: Code[20]): Decimal
var
SalesLine: Record "Sales Line";
TotalAmount: Decimal;
begin
SalesLine.SetRange("Sell-to Customer No.", CustomerNo);
SalesLine.SetRange(Type, SalesLine.Type::Item);
if SalesLine.FindSet() then
repeat
TotalAmount += SalesLine."Amount Including VAT";
until SalesLine.Next() = 0;
exit(TotalAmount);
end;
Understands AL Syntax:
Business Central Awareness:
Context-Aware:
From Comments:
/// Create a page extension for Customer Card that adds loyalty points field
// Generates complete page extension structure
From Partial Code:
procedure ValidateCustomer
// Continue typing... Copilot completes with parameters, logic
From Patterns:
[EventSubscriber(
// Copilot suggests common event patterns
Test Code:
[Test]
procedure TestCustomerValidation
// Generates test structure with Given-When-Then
Boilerplate Code:
Common Patterns:
Code Structure:
Quick Edits:
Complex Business Logic:
Performance-Critical Code:
Security-Sensitive Code:
Copilot (Inline):
Copilot Chat:
Best Practice: Use both together
GitHub Copilot:
Claude:
Best Practice: Copilot for coding, Claude for analysis
GitHub Copilot:
Cursor:
Best Practice: Copilot for standard workflow, Cursor for advanced needs
Input (comment):
/// Customer loyalty tier table with tier name, min points, and discount percentage
Copilot Generates:
table 50100 "Customer Loyalty Tier"
{
DataClassification = CustomerContent;
fields
{
field(1; "Code"; Code[20])
{
Caption = 'Code';
}
field(2; "Tier Name"; Text[50])
{
Caption = 'Tier Name';
}
field(10; "Minimum Points"; Integer)
{
Caption = 'Minimum Points';
MinValue = 0;
}
field(20; "Discount Percentage"; Decimal)
{
Caption = 'Discount Percentage';
MinValue = 0;
MaxValue = 100;
DecimalPlaces = 0 : 2;
}
}
keys
{
key(PK; "Code")
{
Clustered = true;
}
key(Points; "Minimum Points")
{
}
}
}
Input (partial code):
[EventSubscriber(ObjectType::Table, Database::Customer, 'OnAfterValidateEvent', 'Credit Limit (LCY)', false, false)]
Copilot Completes:
local procedure OnAfterValidateCreditLimit(var Rec: Record Customer; var xRec: Record Customer; CurrFieldNo: Integer)
begin
// Add your implementation
if Rec."Credit Limit (LCY)" > 100000 then
if not Confirm('Credit limit exceeds 100,000. Continue?') then
Error('');
end;
Input:
/// API v2.0 page for items exposing no, description, unit price, inventory
Copilot Generates:
page 50100 "Item API"
{
APIVersion = 'v2.0';
APIPublisher = 'yourcompany';
APIGroup = 'inventory';
EntityCaption = 'Item';
EntitySetCaption = 'Items';
PageType = API;
SourceTable = Item;
DelayedInsert = true;
ODataKeyFields = SystemId;
layout
{
area(Content)
{
repeater(GroupName)
{
field(id; Rec.SystemId)
{
Caption = 'Id';
Editable = false;
}
field(number; Rec."No.")
{
Caption = 'No.';
}
field(description; Rec.Description)
{
Caption = 'Description';
}
field(unitPrice; Rec."Unit Price")
{
Caption = 'Unit Price';
}
field(inventory; Rec.Inventory)
{
Caption = 'Inventory';
}
}
}
}
}
Input:
[Test]
procedure TestCustomerCreditLimitValidation
Copilot Suggests:
[Test]
procedure TestCustomerCreditLimitValidation()
var
Customer: Record Customer;
LibrarySales: Codeunit "Library - Sales";
begin
// [GIVEN] A customer with credit limit set
Customer.Init();
Customer."No." := LibrarySales.CreateCustomerNo();
Customer."Credit Limit (LCY)" := 50000;
Customer.Insert();
// [WHEN] Credit limit is exceeded
Customer.Validate("Credit Limit (LCY)", 150000);
// [THEN] Appropriate validation occurs
// Add assertions here
end;
See the detailed GitHub Copilot Tool Page for complete installation instructions.
Quick Start:
VS Code Settings:
{
"github.copilot.enable": {
"*": true,
"al": true
},
"editor.inlineSuggest.enabled": true,
"editor.quickSuggestions": {
"other": true,
"comments": true,
"strings": true
}
}
Project Setup:
app.json
well-configuredWrite Clear Comments:
❌ // calc total
✅ /// Calculate the total sales amount for a customer including tax and discounts
Use Meaningful Names:
❌ procedure Calc(x: Code[20]): Decimal
✅ procedure CalculateCustomerTotalSales(CustomerNo: Code[20]): Decimal
Provide Context:
Before accepting Copilot suggestions:
Effective Use:
Don’t:
Individual:
Business:
Free Trial: Usually 30 days available
Link: GitHub Copilot Pricing
No Suggestions Appearing:
Poor Quality Suggestions:
Slow Performance:
Use With:
Workflow:
Next Steps:
Questions? Join GitHub Discussions
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.