This folder contains practical, copy-paste ready templates for common AL development scenarios in Business Central. These templates implement the standards and patterns defined in the SharedGuidelines and follow Business Central Version 26.0 best practices.
Complete table creation template with:
- ✅ Proper field structure with tooltips starting with "Specifies"
- ✅ Data classification set to CustomerContent
- ✅ Validation triggers with business logic patterns
- ✅ FlowFields and keys following performance guidelines
- ✅ Standard triggers (OnInsert, OnModify, OnDelete, OnRename)
- ✅ Enum definition for status fields
- ✅ Fieldgroups for DropDown and Brick displays
Usage:
- Copy the template file
- Replace
[ObjectID],[Prefix],[EntityName]with your values - Customize fields, validation logic, and business rules
- Add specific FlowFields and relationships as needed
Complete page creation templates including:
- ✅ Proper layout with General, Details, and Statistics groups
- ✅ FactBoxes with related information and system parts
- ✅ Actions with Processing, Navigation, and Reporting areas
- ✅ Promoted actions using actionref syntax (no PromotedCategory)
- ✅ Field validation and UI interaction patterns
- ✅ ApplicationArea set to All for all fields
- ✅ Repeater control with proper field selection
- ✅ Bulk operations and selection handling
- ✅ Export capabilities to Excel and reports
- ✅ FactBox integration for additional information
- ✅ Style expressions for visual indicators
Usage:
- Copy the relevant page template
- Replace
[ObjectID],[Prefix],[EntityName]with your values - Customize fields, actions, and business logic
- Add specific FactBoxes and related pages
Two comprehensive codeunit patterns:
- ✅ CRUD operations with validation and error handling
- ✅ Business logic procedures following Single Responsibility Principle
- ✅ Event publishers for extensibility (OnBefore/OnAfter patterns)
- ✅ Event subscribers for table events
- ✅ Batch processing with progress indication
- ✅ Statistics and helper functions
- ✅ Multi-stage workflow processing with comprehensive error handling
- ✅ Business event patterns for major functionality
- ✅ Integration events for external system connectivity
- ✅ Progress tracking and user notification
- ✅ Validation and business rule enforcement
Usage:
- Choose Management template for simple operations, Workflow for complex processes
- Replace
[ObjectID],[Prefix],[EntityName]with your values - Implement specific business logic in the marked areas
- Add custom validation rules and processing steps
Comprehensive test codeunit template with:
- ✅ Complete test coverage for CRUD operations
- ✅ Arrange-Act-Assert pattern for all test methods
- ✅ Test data generation with X prefix following TestingValidation standards
- ✅ Performance testing patterns with timing validation
- ✅ Event testing for subscribers and publishers
- ✅ Error scenario testing with asserterror patterns
- ✅ Test handlers for UI interactions (Confirm, Message, Page handlers)
- ✅ Test isolation and cleanup procedures
Usage:
- Copy the test template
- Replace
[ObjectID],[Prefix],[EntityName]with your values - Add specific test scenarios for your business logic
- Implement test data creation helpers
- Add custom validation assertions
Replace these placeholders throughout the templates:
| Placeholder | Description | Example |
|---|---|---|
[ObjectID] |
Your object ID number | 50100 |
[Prefix] |
Your extension prefix | ABC |
[EntityName] |
Your business entity name | Customer Rating |
[KeyParameters] |
Method parameters | CustomerNo: Code[20]; Description: Text[100] |
[Related Table] |
Related table name | ABC Customer Rating Detail |
[Key Field] |
Foreign key field | Customer Rating No. |
From Template:
table [ObjectID] "[Prefix] [EntityName]"
{
Caption = '[EntityName]';
// ...
}To Implementation:
table 50100 "ABC Customer Rating"
{
Caption = 'Customer Rating';
// ...
}These templates leverage the latest AL features including:
- ✅ Modern enum syntax for status fields
- ✅ Improved error handling patterns
- ✅ Performance optimization with SetLoadFields
- ✅ Enhanced event patterns for extensibility
- ✅ Current UI patterns with proper actionref syntax
- ✅ Data classification compliance
- ✅ Accessibility standards implementation
- Naming Conventions:
SharedGuidelines/Standards/naming-conventions.md - Code Style:
SharedGuidelines/Standards/code-style.md - Error Handling:
SharedGuidelines/Standards/error-handling.md - Core Principles:
SharedGuidelines/Configuration/core-principles.md
- CoreDevelopment: Object patterns and development standards
- TestingValidation: Test data patterns and testing strategies
- PerformanceOptimization: SetLoadFields and optimization patterns
- AppSourcePublishing: Marketplace compliance requirements
- Choose the appropriate template based on your development scenario
- Copy the template file to your AL project directory
- Replace all placeholders with your specific values
- Customize business logic according to your requirements
- Test thoroughly using the test template patterns
- Review compliance with SharedGuidelines standards
These templates provide a solid foundation for AL development while ensuring consistency with the established workflow standards and Business Central best practices.