Cursor is an AI-first code editor built on VS Code that integrates AI deeply into every aspect of development. It provides inline suggestions, chat assistance, and advanced features like Composer mode for multi-file editing, making it a powerful tool for AL development.
Developer: Anysphere Inc.
Type: AI-Integrated Code Editor
Primary Use: Complete AI-assisted development environment
Integration: Native (is a code editor)
Cursor is a fork of Visual Studio Code with integrated AI capabilities:
Unlike tools that add AI to VS Code, Cursor is an AI-first editor built from the ground up with AI integration.
Think of it as: VS Code + GitHub Copilot + Advanced AI Features + Better Context Understanding
Real-time AI suggestions as you type:
// Type a comment
/// Validate customer credit limit
// Cursor suggests complete procedure
procedure ValidateCreditLimit(CustomerNo: Code[20]): Boolean
var
Customer: Record Customer;
begin
// Full implementation suggested
end;
Plus:
Built-in AI chat in the sidebar:
Plus:
Quick inline AI assistance:
Cmd+K
(Mac) or Ctrl+K
(Windows)Example:
// Select code, press Cmd+K, type:
"Add error handling and telemetry"
// Cursor shows diff with changes
// Accept to apply
Most Powerful Feature: Multi-file editing with AI
Example:
Press Cmd+I (Composer)
Type: "Add a loyalty points system with table, page, and codeunit"
Cursor creates:
- Table 50100 "Loyalty Points Entry"
- Page 50100 "Loyalty Points List"
- Page 50101 "Loyalty Points Card"
- Codeunit 50100 "Loyalty Points Manager"
All properly connected and following AL patterns
Cursor indexes your entire workspace:
Benefit for AL:
Choose your AI model:
Why it matters:
Multi-File Projects:
Composer: "Create a complete order processing module with:
- Order Header and Line tables
- Card and List pages
- Processing codeunit
- Validation codeunit
- Test codeunit
Follow AL best practices"
Cursor creates all files properly structured and connected.
Large Refactoring:
"Refactor this project to:
- Add telemetry to all procedures
- Standardize error handling
- Add XML documentation
- Update to use new AL patterns"
Cursor makes changes across all relevant files.
Project Generation:
"Create a BC extension for customer surveys with:
- Setup tables
- Survey and response tables
- Pages for all tables
- Email sending logic
- API for mobile access"
Cursor scaffolds entire extension.
Codebase Understanding:
Learning Curve:
Cost:
AL-Specific Training:
Command (in Composer, Cmd+I
):
Create a complete customer discount management system:
Tables:
- Discount Group Setup (code, description, percentage)
- Customer Discount Assignment (customer no, discount group)
Pages:
- List and Card pages for each table
Codeunit:
- Calculate discount based on customer's group
- Apply discount to sales lines
- Event subscribers for sales line validation
Include:
- Proper AL naming conventions
- XML documentation
- Error handling
- Data classification
Cursor Creates (all files):
Created Files:
✓ Tables/DiscountGroupSetup.Table.al
✓ Tables/CustomerDiscountAssignment.Table.al
✓ Pages/DiscountGroupSetupList.Page.al
✓ Pages/DiscountGroupSetupCard.Page.al
✓ Pages/CustomerDiscountAssignmentList.Page.al
✓ Codeunits/DiscountManager.Codeunit.al
All files properly structured with:
- AL best practices
- XML documentation
- Event subscribers
- Error handling
You (in Chat):
Review this codeunit for performance and best practices:
[Paste codeunit]
Specifically check:
- Database operations
- AL patterns
- Error handling
- Code analyzers compliance
Cursor Analyzes:
Found several issues:
1. Performance Issue (Lines 45-52):
Multiple FindSet without SetLoadFields
Current:
SalesLine.SetRange("Document No.", OrderNo);
if SalesLine.FindSet() then
Recommended:
SalesLine.SetRange("Document No.", OrderNo);
SalesLine.SetLoadFields(Quantity, "Unit Price", Amount);
if SalesLine.FindSet() then
2. Missing Error Handling (Lines 67-70):
No try-catch for posting operation
[Shows specific improvements]
3. CodeCop Violations:
- Procedure names don't follow AL naming
- Missing XML documentation
[Lists specific fixes needed]
Would you like me to apply these fixes?
Select procedure, press Cmd+K:
"Add Application Insights telemetry to track execution time and parameters"
Cursor Shows Diff:
- procedure ProcessOrder(OrderNo: Code[20])
+ procedure ProcessOrder(OrderNo: Code[20])
var
SalesHeader: Record "Sales Header";
+ Telemetry: Codeunit Telemetry;
+ CustomDimensions: Dictionary of [Text, Text];
+ StartTime: DateTime;
begin
+ StartTime := CurrentDateTime;
+ CustomDimensions.Add('OrderNo', OrderNo);
+
+ Telemetry.LogMessage('ORDER-001', 'Processing order started',
+ Verbosity::Normal, DataClassification::SystemMetadata,
+ TelemetryScope::ExtensionPublisher, CustomDimensions);
+
// Existing code...
+
+ CustomDimensions.Add('Duration', Format(CurrentDateTime - StartTime));
+ Telemetry.LogMessage('ORDER-002', 'Processing order completed',
+ Verbosity::Normal, DataClassification::SystemMetadata,
+ TelemetryScope::ExtensionPublisher, CustomDimensions);
end;
Accept with Cmd+Enter
, reject with Cmd+Backspace
You:
@codebase How is customer validation currently implemented in this project?
Cursor (searches entire project):
Found customer validation in 3 places:
1. Codeunit 50100 "Customer Validator" (Lines 23-45):
- Main validation logic
- Checks blocked status
- Validates credit limit
2. Table Extension 50100 "Customer Extension" (Lines 15-20):
- OnValidate trigger for custom field
3. Event Subscriber in Codeunit 50105 (Lines 67-80):
- Subscribes to Customer OnAfterValidate
- Adds additional custom validation
Recommendation: Consolidate validation logic into single codeunit
for better maintainability.
[Shows code snippets from each location]
Cursor:
Copilot:
Cursor:
Claude:
Note: Cursor can use Claude as its AI model, giving you best of both!
Cursor:
VS Code + Copilot:
Download Cursor
Sign Up
Configure AL Development
Import Settings:
Cursor > Settings > Import Settings from VS Code
Your Extensions:
Keyboard Shortcuts:
Cmd+K
: Inline editCmd+L
: ChatCmd+I
: ComposerWorkspace Setup:
app.json
well-configuredAI Model Selection:
Clear Instructions:
Good:
"Create AL customer loyalty system with:
- Tier setup table (code, name, min points, discount %)
- Customer points table (customer no, points, tier code)
- List and card pages for both
- Codeunit to calculate and assign tiers
- Event subscriber to update on purchase
Follow AL naming conventions and add XML docs"
Poor:
"Make a loyalty system"
Iterative Development:
Reference Files:
@filename.al What does this procedure do?
@codebase How is posting handled in this project?
Specific Questions:
"Review CustomerProcessor.codeunit.al for:
- Performance issues
- AL best practices
- Missing error handling"
Targeted Changes:
Pro Plan: $20/month
Business Plan: Custom pricing
Free Trial: 14 days (typically)
Link: Cursor Pricing
Use With:
Workflow:
Provide AL Context:
"Generate AL code for Business Central v22..."
"Follow AL naming conventions..."
"Use BC standard posting patterns..."
Use Codebase Context:
@codebase Reference existing table structures
@CustomerTable.al Follow this naming pattern
Leverage Models:
Iterate:
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.