Top 10 reusable prompts — Review Business Central AL code as a senior developer (with suggested fixes + code snippets)
Copy any prompt, paste your AL code where indicated, and send to the model. Each prompt follows the structure you asked: Role Assignment + Clear Task/Goal + Context/Constraints + Desired Output Format.
Performance review — reduce DB calls
Role Assignment: Act as a senior Business Central AL performance engineer.
Task/Goal: Review the pasted AL code and identify places that cause excessive database reads/writes; propose changes to minimize I/O.
Context/Constraints: Code runs on Sales Order processing for large datasets (100k+ lines). Avoid changing business logic; focus on batching, FindSet/Update, use of Temporary tables, and FlowFields.
Desired Output Format: List of detected performance issues (numbered) + short explanation each + a corrected code snippet showing the hottest function refactored (before/after) and a brief benchmark plan to validate improvement.
Placeholder:[PASTE AL CODE HERE]
-
Eventing & extensibility review
Role Assignment: Act as a senior AL architect specializing in events and extensibility.
Task/Goal: Review the pasted code for hard-coded hooks and suggest how to expose IntegrationEvents/BusinessEvents to make it extensible without breaking changes.
Context/Constraints: Target solution must support extensibility by partners and follow MS naming conventions and var/const patterns. Keep backward compatibility in mind.
Desired Output Format: Identified rigidity points + recommended event publishers/subscribers with full AL event code snippets (publisher + example subscriber) and guidance where to place them (object & trigger).
Placeholder:[PASTE AL CODE HERE]
-
Error handling & user messaging
Role Assignment: Act as a senior AL reliability engineer.
Task/Goal: Review error handling in the pasted code and propose a robust TRY-CATCH strategy, consistent error messages, and error logging.
Context/Constraints: Use GetLastErrorText(), store errors in a “Log Entries” table, and avoid exposing raw system exceptions to end users. Support multi-language captions.
Desired Output Format: Short list of problems found + a standardized TRY-CATCH wrapper code snippet + example of how to log and present a friendly message to the user (before/after).
Placeholder:[PASTE AL CODE HERE]
-
Security & permission review
Role Assignment: Act as a senior BC security/permissions specialist.
Task/Goal: Review code for permission/security issues (sensitive data, direct SQL, misuse of CurrPage, functions callable by users) and recommend PermissionSet/Object-level controls.
Context/Constraints: Target Business Central best practices; avoid runtime elevation; prefer PermissionSet definitions over role assumptions.
Desired Output Format: List of security risks + recommended PermissionSet XML/AL snippet(s) + code changes to enforce checks (e.g., CurrUserHasPermission) with an example enforcement snippet.
Placeholder:[PASTE AL CODE HERE]
-
Code quality & maintainability review
Role Assignment: Act as a senior AL code-quality lead.
Task/Goal: Review pasted code for naming, single-responsibility, duplication, and adherence to AL style rules; produce refactoring suggestions.
Context/Constraints: Keep public APIs stable; prefer small, testable procedures; follow camelCase for locals and PascalCase for procedures.
Desired Output Format: Priority-ranked list of refactors + one example refactor transforming a large procedure into 2–3 small procedures with full before/after AL code snippets.
Placeholder:[PASTE AL CODE HERE]
-
Unit testing & testability review
Role Assignment: Act as a senior AL testing engineer.
Task/Goal: Evaluate the pasted code for testability; suggest unit tests and mocks; provide test codeunits.
Context/Constraints: Use the AL Test Framework (TestToolKit patterns), isolate tests per company, avoid external dependencies in tests.
Desired Output Format: Problems preventing testability + 2–3 unit test codeunits (Arrange/Act/Assert) that target key logic + suggestions for required refactors to enable tests.
Placeholder:[PASTE AL CODE HERE]
-
Concurrency & Job Queue safety review
Role Assignment: Act as a senior AL concurrency/operations engineer.
Task/Goal: Review code for concurrency issues (deadlocks, race conditions) and propose Job Queue or locking patterns.
Context/Constraints: Code runs in multi-user environment; some functions are executed by Job Queue concurrently; preserve idempotency.
Desired Output Format: Detected concurrency risks + recommended locking or optimistic concurrency changes + example AL pattern using Record.LockTable / Job Queue-safe code snippet.
Placeholder:[PASTE AL CODE HERE]
-
Integration / API reliability review
Role Assignment: Act as a senior AL integration architect.
Task/Goal: Review REST/HttpClient or JSON handling in the pasted code. Suggest improvements for retries, timeouts, JSON parsing, and secure credential handling.
Context/Constraints: Use HttpClient, JsonObject, secure storage for keys (Azure Key Vault or BC Credential Management), implement exponential backoff for retries.
Desired Output Format: Identified fragilities + hardened HttpClient wrapper code snippet showing retry/backoff + secure key retrieval example + parsing error handling snippet.
Placeholder:[PASTE AL CODE HERE]
-
Upgrade & data migration review
Role Assignment: Act as a senior AL upgrade/migration engineer.
Task/Goal: Review the pasted upgrade/codeunit or migration logic; propose an OnUpgradePerCompany plan that is idempotent and safe for large datasets.
Context/Constraints: Support rollback-friendly steps, progress logging, batch processing for millions of rows, and compatibility with older versions.
Desired Output Format: Step-by-step upgrade plan + AL upgrade codeunit sample performing safe batched migrations (with checkpoints) and logging.
Placeholder:[PASTE AL CODE HERE]
-
UI/UX & page performance review
Role Assignment: Act as a senior AL UI/UX engineer.
Task/Goal: Review Page/PageExtension code for usability and performance (too many FlowFields, heavy OnOpenPage logic). Provide improvements.
Context/Constraints: Keep ApplicationArea and ToolTips; minimize synchronous long-running logic on page open; use FactBoxes or background jobs if needed.
Desired Output Format: Usability issues (bulleted) + revised Page/PageExtension code snippet replacing heavy OnOpenPage with an async JobQueue call or optimizing FlowFields (before/after).
Placeholder:[PASTE AL CODE HERE]
50 reusable prompts — Review, Universal Code Initiative (UCI), Best Practices & AI-optimized coding rules for Business Central AL
| Prompt ID | Scenario | Role and Prompt Example (Hinglish/English) |
|---|---|---|
| 1 | Naming Conventions Review | Act as Senior BC AL Developer. Review this AL code for adherence to Universal Code Initiative (UCI) naming conventions. Suggest improvements and a corrected code snippet. |
| 2 | Code Readability Enhancement | As Senior Developer, review this AL code focusing on readability and maintainability. Provide refactored code with comments. |
| 3 | Performance Best Practices | Acting as AL Performance Expert, analyze code for expensive loops and DB calls. Suggest best practice optimizations with code snippet improvements. |
| 4 | Data Classification Compliance | As Security Expert, check the code for proper data classification usage per Universal Code Initiative. Suggest fixes with examples. |
| 5 | Error Handling & Logging | Review AL procedure for robust error handling aligned with best practices. Suggest enhanced try/catch and logging implementation with code example. |
| 6 | Modular Code Review | Analyze AL code for modularity and single responsibility principle compliance. Suggest refactorings and provide example modular code parts. |
| 7 | Event Handling Efficiency | Review event subscriber implementation for efficient event handling and avoidance of common pitfalls. Suggest refined code snippet. |
| 8 | UI/UX Consistency Check | Review page extensions and UI modifications for consistency with Business Central UX guidelines. Provide improved AL UI code. |
| 9 | Security & Permission Checks | Validate code for adequate permission and security checks before sensitive operations. Provide refactored secure code snippet. |
| 10 | Unit Testability Assessment | Evaluate code structure for ease of unit testing. Suggest improvements and create sample unit test and refactored code. |
| 11 | Inline Documentation Quality | Review inline comments and XML documentation. Suggest improvements and show enhanced documented code. |
| 12 | API Integration Conformance | Analyze AL code integrating with external APIs for adherence to best practices and error handling. Propose improved API consuming code. |
| 13 | Custom Error Messages | Check clarity and user friendliness of error messages in AL code. Propose improved messages with examples. |
| 14 | Localization Support | Review code for proper use of localization and labels. Provide improved localization-ready AL code snippet. |
| 15 | Use of Constants and Enumerations | Review magic numbers and strings replaced appropriately with constants/enums. Suggest improvements and code examples. |
| 16 | Deprecation and Compatibility | Evaluate code for deprecated calls and ensure compatibility with the latest BC versions. Suggest compliant code changes. |
| 17 | Extension Upgrade Readiness | Assess code readiness for smooth upgrades and migration scenarios. Include improved upgrade-safe code snippets. |
| 18 | Code Duplication Elimination | Identify duplicated code blocks. Suggest abstractions or functions to eliminate duplication with examples. |
| 19 | Secure Data Handling | Check encryption and secure handling of sensitive data fields. Provide improved secure handling code. |
| 20 | Query Optimization | Review database queries and filter usage for optimization. Suggest better AL query syntax or code restructuring. |
| 21 | Proper Use of Try Functions | Check use of Try functions for non-intrusive error handling. Suggest improvements and code examples. |
| 22 | Meaningful Variable Names | Review for meaningful variable names. Suggest renaming to enhance clarity and provide before-after code snippet. |
| 23 | Code Formatting Standards | Check for consistent code formatting (indentation, spacing). Provide reformatted code snippet. |
| 24 | User Permission Sets | Review creation and use of user permission sets. Suggest best practice AL code for permission management. |
| 25 | Batch Job Safety | Evaluate scheduling and batch jobs code for robustness. Propose safer code approaches with examples. |
| 26 | Minimal Data Exposure | Check for exposure of only necessary data, avoiding oversharing. Suggest code to limit data exposure. |
| 27 | Use of Code Analyzers | Assess the use of AL code analyzers. Suggest fixes for analyzer warnings and improved code style. |
| 28 | Table Relation Integrity | Review table relation declaration for consistency and performance. Suggest improved relationship definitions. |
| 29 | Deprecated Function Replacement | Identify deprecated functions. Suggest modern equivalents with code samples. |
| 30 | Meaningful Error Logging | Review logging strategy for error traceability. Improve log entries and provide better logging code. |
| 31 | Refactor Long Functions | Find overly long functions. Propose splitting into smaller, reusable functions with examples. |
| 32 | Consistent Use of Page Controls | Check page control usage for consistency and maintainability. Suggest code improvements. |
| 33 | Proper Use of Temporary Tables | Review temporary table usage in processing logic. Suggest best practices and improved code. |
| 34 | Comprehensive Test Coverage | Evaluate the codebase for unit test coverage. Suggest additional test cases and example tests. |
| 35 | Proper Use of Recurring Jobs | Review scheduling of recurring jobs for business logic. Suggest improvements for reliability. |
| 36 | Efficient Use of DataItem Filters | Review use of filters in reports. Suggest improvements for performance and clarity. |
| 37 | Clear Separation of Concerns | Assess logical separation of UI, business logic, and data access layers. Suggest refactoring suggestions. |
| 38 | Use of New AL Language Features | Review use of latest AL language features for efficiency and clarity. Suggest code upgrades. |
| 39 | Localization-Friendly UI | Check UI code for localization readiness. Suggest improvements for internationalization. |
| 40 | Consistent Use of Data Types | Verify consistent application of appropriate data types. Suggest corrections where needed. |
| 41 | Safe Codeunit Instancing | Review codeunit usage for safe and optimal instancing practices. Provide improved usage examples. |
| 42 | Minimize Cross-Table Access | Identify and optimize excessive cross-table access patterns. Suggest improved data access patterns. |
| 43 | Clear Function Responsibility | Review functions for single responsibility. Suggest improvements with example function splits. |
| 44 | Use of Interface and Abstraction | Check for use of interfaces and abstraction layers. Suggest adding these where appropriate. |
| 45 | Security Roles-Related Code Review | Evaluate code related to security roles and permissions. Suggest tightened security implementations. |
| 46 | Dependency Injection Usage | Check for DI usage where applicable. Suggest code improvements to use dependency injection. |
| 47 | Error Context Clarity | Review error messages and logging for sufficient context. Provide clearer error handling code. |
| 48 | Cleanup Resources Properly | Check code for proper cleanup of resources (e.g., restore cursor, reset temp tables). Provide improved snippets. |
| 49 | Use of Modern Debugging Practices | Suggest use of modern AL debugging practices. Suggest code additions for logging and telemetry. |
| 50 | Documentation Completeness | Review code comments and external documentation. Suggest adding missing documentation blocks with examples. |
General code quality & architecture
-
Role Assignment: Act as a senior Business Central AL architect and UCI reviewer.
Task/Goal: Perform a full-code review of the pasted AL file for adherence to Universal Code Initiative (UCI) and AL best practices.
Context/Constraints: Keep public API stable, don't alter business logic, mark breaking changes clearly.
Desired Output Format: Numbered list of issues (severity), remediation suggestions, 2–3 before/after snippets for the most critical fixes, and a short risk/impact note. -
Role Assignment: Act as a senior AL refactoring expert.
Task/Goal: Identify long procedures (>200 lines) and refactor suggestions to follow single-responsibility and modular design.
Context/Constraints: Maintain original behavior; preserve variable names used externally.
Desired Output Format: List of candidate procedures + concrete refactor split with before/after code snippets and suggested new procedure names. -
Role Assignment: Act as a SOLID and UCI specialist.
Task/Goal: Review object for violations of SOLID principles and propose concrete code-level changes.
Context/Constraints: Show how to separate concerns without changing external signatures.
Desired Output Format: For each violation: explanation, proposed pattern (interface/codeunit split), and example AL code demonstrating the fix. -
Role Assignment: Act as a naming-standards reviewer.
Task/Goal: Check naming for tables, variables, procedures, and constants against UCI naming rules and Microsoft AL conventions.
Context/Constraints: Suggest consistent camelCase for locals, PascalCase for procedures, prefixes for globals.
Desired Output Format: Table of problematic identifiers + suggested replacements + automated regex rules to find occurrences. -
Role Assignment: Act as a code-linter rules author (AL).
Task/Goal: Generate a set of UCI/AI-friendly linting rules for AL (e.g., max procedure length, no magic numbers, explicit var/const).
Context/Constraints: Rules must be actionable and automatable by a pre-commit tool.
Desired Output Format: Enumerated lint rules + example violation and corrected snippet for each.
Performance & database I/O
-
Role Assignment: Act as an AL performance engineer.
Task/Goal: Find excessive DB reads/writes in pasted code and propose batching/temp table usage.
Context/Constraints: Target large datasets (100k+ rows). Avoid changing final results.
Desired Output Format: Hotspots list + optimized code snippet (FindSet/Update batching or use of Temporary table) + explanation of complexity reduction. -
Role Assignment: Act as an index and key advisor.
Task/Goal: Review table usage and suggest key/index changes or FlowField alternatives to improve read performance.
Context/Constraints: Include potential impact on writes and Explain how to update keys safely.
Desired Output Format: Table of suggested key changes + AL table code snippet for key change + migration consideration notes. -
Role Assignment: Act as an AL caching expert.
Task/Goal: Propose a caching strategy to reduce repetitive lookups in the pasted code.
Context/Constraints: Use single-instance codeunit or in-memory temporary records; ensure cache invalidation.
Desired Output Format: Cache implementation code snippet + invalidation rules and example usage. -
Role Assignment: Act as a FlowField optimization specialist.
Task/Goal: Identify problematic FlowFields used in UI triggers and recommend precomputed alternatives or job-queue calculation.
Context/Constraints: Minimize synchronous computation on page load.
Desired Output Format: Example refactor from FlowField → stored aggregate + Job Queue code snippet to recalc. -
Role Assignment: Act as a memory & tempblob reviewer.
Task/Goal: Audit code for heavy memory/tempblob usage and propose streaming or chunked processing alternatives.
Context/Constraints: Target file imports and large JSON payloads.
Desired Output Format: Problem summary + chunked processing AL snippet and recommended safe buffer sizes.
Events, extensibility & UCI patterns
-
Role Assignment: Act as an event-design authority (UCI patterns).
Task/Goal: Review the object for hard-coded extension points and propose IntegrationEvent/BusinessEvent publishers/subscribers to enable extensibility.
Context/Constraints: Keep parameter VAR where appropriate; follow naming conventions OnBefore/OnAfter.
Desired Output Format: Suggested event publishers + example publisher + example subscriber code. -
Role Assignment: Act as backward-compatibility reviewer.
Task/Goal: Identify potential breaking changes and propose UCI-compatible extension points to avoid them.
Context/Constraints: Provide migration path for existing consumers.
Desired Output Format: List of breaking points + suggested non-breaking alternatives + sample event-based replacement snippet. -
Role Assignment: Act as an API contract guardian.
Task/Goal: Verify exposed API pages/queries for stable field names and versioned contracts.
Context/Constraints: Propose strategy for versioned API pages and deprecation headers.
Desired Output Format: Versioning scheme + code snippet for API page v1 → v2 and deprecation notice. -
Role Assignment: Act as an UCI module interface designer.
Task/Goal: Recommend modular boundaries and interfaces for the pasted extension (to make modules independently testable).
Context/Constraints: Use AL interfaces and small codeunits.
Desired Output Format: Proposed module map + interface AL code + sample implementation. -
Role Assignment: Act as an event conflict detection expert.
Task/Goal: Detect situations where multiple subscribers may conflict and propose ordering or filter patterns.
Context/Constraints: Preserve idempotency; avoid implicit side effects.
Desired Output Format: Conflicting subscribers list + recommended subscriber filters/priorities + sample safe subscriber.
Error handling, logging & telemetry
-
Role Assignment: Act as a reliability/UCI logging lead.
Task/Goal: Review error handling and transform ad-hoc messages into standardized, localizable errors + structured telemetry.
Context/Constraints: Use GetLastErrorText(), Session.LogMessage, and a custom Log table. Avoid exposing stack traces to users.
Desired Output Format: Standard TRY/CATCH wrapper + logging codeunit snippet + sample log record schema. -
Role Assignment: Act as a telemetry optimization engineer.
Task/Goal: Propose telemetry points to capture performance and business metrics in pasted code.
Context/Constraints: Low overhead; GDPR-compliant (no PII).
Desired Output Format: List of telemetry events + AL code to send Session.LogMessage + example event payload. -
Role Assignment: Act as an alerting & retry expert.
Task/Goal: Add retry/backoff logic for external calls in the pasted code and alert rules for failures.
Context/Constraints: Implement exponential backoff with max retries and logging.
Desired Output Format: HttpClient wrapper code with retry/backoff + alerting log snippet. -
Role Assignment: Act as a localized message & UX reviewer.
Task/Goal: Replace hard-coded English messages with resource captions and multi-language support.
Context/Constraints: Provide ENU and one other language example.
Desired Output Format: Example of Message/Err/Confirm replaced with Label and translations + AL resource snippet. -
Role Assignment: Act as an audit & compliance specialist.
Task/Goal: Ensure actions are auditable (who/when/what) and add minimal audit logs for critical operations.
Context/Constraints: Store minimal PII; fields must be DataClassification annotated.
Desired Output Format: Audit table design + sample LogAction procedure + usage examples.
Security & permissions
-
Role Assignment: Act as a BC security architect.
Task/Goal: Review code for insecure patterns (hard-coded credentials, direct DB calls, elevation of privileges).
Context/Constraints: Recommend secure storage and usage patterns.
Desired Output Format: Risk list + secure alternative code snippets (Credential Management, Azure Key Vault example pseudo-code). -
Role Assignment: Act as a PermissionSet reviewer.
Task/Goal: Generate minimal permission sets needed for new features in pasted code and highlight over-privileged operations.
Context/Constraints: Follow least-privilege principle.
Desired Output Format: PermissionSet AL object snippets + mapping of objects → required permissions. -
Role Assignment: Act as an input-sanitization expert.
Task/Goal: Ensure external inputs (JSON, CSV, API payloads) are validated and sanitized before use.
Context/Constraints: Provide defensive parsing patterns and schema checks.
Desired Output Format: Validation helper code + JSON schema-like checks + example sanitization snippet. -
Role Assignment: Act as a secure integration specialist.
Task/Goal: Review external API integration patterns in pasted code and enforce token handling/security best practices.
Context/Constraints: Use secure storage for secrets, avoid logging tokens.
Desired Output Format: Secure HttpClient usage snippet + token refresh and storage pattern. -
Role Assignment: Act as a data-classification & PII reviewer.
Task/Goal: Identify PII fields and recommend DataClassification labels and access controls per UCI.
Context/Constraints: Use Microsoft DataClassification categories.
Desired Output Format: Annotated field list + AL snippet showing DataClassification attributes.
Testing, CI/CD & DevOps
-
Role Assignment: Act as a unit-testing lead.
Task/Goal: Propose unit tests for key functions in pasted code and provide test codeunits.
Context/Constraints: Use AL Test Framework, isolate per company, and mock external dependencies.
Desired Output Format: 2–3 AL test codeunits (Arrange/Act/Assert) + mock patterns. -
Role Assignment: Act as a testability refactorer.
Task/Goal: Identify barriers to testability (static code, external calls inside logic) and refactor examples to enable mocking.
Context/Constraints: Show before/after to allow unit tests without external resources.
Desired Output Format: Refactor snippet + sample test consuming the refactored code. -
Role Assignment: Act as a CI/CD pipeline adviser for AL.
Task/Goal: Provide a CI step checklist that enforces UCI rules (lint, unit tests, code coverage threshold, symbol validation).
Context/Constraints: GitHub Actions / Azure DevOps friendly.
Desired Output Format: YAML snippet outline + commands for checks. -
Role Assignment: Act as an automated release/versioning expert.
Task/Goal: Propose a versioning scheme for app.json and pipeline automation to bump versions safely.
Context/Constraints: Major.Minor.Patch with build metadata; preserve compatibility.
Desired Output Format: PowerShell or YAML snippet to auto-increment version + guidelines. -
Role Assignment: Act as a build stability engineer.
Task/Goal: Detect symbol dependencies and recommend ways to pin or resolve missing symbols during automated builds.
Context/Constraints: Prefer symbols feed or explicit dependencies in pipeline.
Desired Output Format: Troubleshooting steps + pipeline snippet to fetch symbols.
UI, pages, role centers & user experience
-
Role Assignment: Act as a UX-focused senior AL dev.
Task/Goal: Review Page / PageExtension code for usability and propose changes to improve flow and reduce cognitive load.
Context/Constraints: Maintain existing fields; avoid heavy OnOpenPage logic.
Desired Output Format: Bulleted UX issues + code snippets to refactor (FactBox, FastTabs, conditional visibility). -
Role Assignment: Act as a RoleCenter designer.
Task/Goal: Suggest optimal Cues and KPIs for a given role and provide AL code for RoleCenter and Cues.
Context/Constraints: Use performant queries and avoid FlowFields on RoleCenter.
Desired Output Format: RoleCenter code + Query or Cue code snippet. -
Role Assignment: Act as an accessibility reviewer.
Task/Goal: Ensure pages and captions are screen-reader friendly and labels are clear.
Context/Constraints: Use concise captions and ToolTips; avoid ambiguity.
Desired Output Format: List of accessibility issues + corrected Page snippet and caption examples. -
Role Assignment: Act as a page-performance optimizer.
Task/Goal: Replace synchronous heavy OnOpenPage logic with Job Queue or background tasks.
Context/Constraints: Provide sample Job Queue code; ensure user feedback for long tasks.
Desired Output Format: Before/after Page code + Job Queue codeunit snippet. -
Role Assignment: Act as an inline-help/documentation engineer.
Task/Goal: Add contextual help (ToolTips, HelpPage links) to critical fields and actions.
Context/Constraints: Support multiple languages and short actionable text.
Desired Output Format: Page extension snippet with ToolTips and Label entries.
Reporting, layouts & data export
-
Role Assignment: Act as a report performance specialist.
Task/Goal: Review report object or reportextension for inefficient dataset or grouping and propose improvements.
Context/Constraints: Support large volumes and pagination where possible.
Desired Output Format: Optimized report dataset snippet + advice on RDLC vs Word performance. -
Role Assignment: Act as a layout/localization reviewer.
Task/Goal: Make RDLC/Word layout multi-language friendly and minimize layout rendering time.
Context/Constraints: Keep layout simple and use aggregates where possible.
Desired Output Format: Layout structuring guidance + sample dataset XML snippet. -
Role Assignment: Act as an export-data governance specialist.
Task/Goal: Ensure CSV/Excel exports in pasted code handle encoding, large row counts and PII redaction.
Context/Constraints: Stream rows and apply DataClassification rules.
Desired Output Format: Streaming CSV export AL snippet + PII masking example. -
Role Assignment: Act as a scheduled-reporting expert.
Task/Goal: Convert heavy on-demand report into scheduled Job Queue based report and provide code.
Context/Constraints: Ensure deliverability (email/SFTP) and retry logic.
Desired Output Format: Job Queue codeunit + report call snippet + delivery example. -
Role Assignment: Act as a dataset-compactness reviewer.
Task/Goal: Reduce dataset size by selecting only needed fields and using summary items; recommend query usage.
Context/Constraints: Balance between server-side aggregation and client needs.
Desired Output Format: Proposed dataset fields list + AL Query or Report dataset snippet.
Integration, JSON, HttpClient & external APIs
-
Role Assignment: Act as an API reliability architect.
Task/Goal: Harden pasted HttpClient calls for retries, timeouts, and error classification.
Context/Constraints: Use exponential backoff and circuit-breaker-like guards.
Desired Output Format: Robust HttpClient wrapper AL snippet with retry/backoff and logging. -
Role Assignment: Act as a JSON robustness engineer.
Task/Goal: Make JSON parsing resilient to schema changes and missing fields.
Context/Constraints: Use JsonObject.TryGet and safe conversions.
Desired Output Format: Safe JSON parsing AL snippet + example of tolerant mapping. -
Role Assignment: Act as OAuth/token lifecycle manager.
Task/Goal: Provide secure token storage and refresh flow for an external API integration.
Context/Constraints: Minimize exposure and avoid long-lived tokens in code.
Desired Output Format: Token storage pattern + refresh snippet + secure retrieval code. -
Role Assignment: Act as a webhook and event sink expert.
Task/Goal: Review webhook consumer logic and improve idempotency and dedup handling.
Context/Constraints: Use unique message Ids and a dedup store table.
Desired Output Format: Idempotent webhook handler AL snippet + dedup table design. -
Role Assignment: Act as a CSV/Import robustness expert.
Task/Goal: Improve CSV import code to handle malformed rows, encoding issues and resume on failure.
Context/Constraints: Batch processing with checkpointing.
Desired Output Format: Robust import codeunit snippet with checkpointing and error log.
Upgrade, migration & versioning
-
Role Assignment: Act as a UCI upgrade/migration lead.
Task/Goal: Create an idempotent OnUpgradePerCompany plan for data transformations in the pasted upgrade code.
Context/Constraints: Support resume on failure and batched execution for large tables.
Desired Output Format: Upgrade codeunit snippet with batching, logging and checkpointing. -
Role Assignment: Act as a deprecation & obsoletion planner.
Task/Goal: Propose safe deprecation strategy for fields/objects (ObsoleteState usage) and replacement path.
Context/Constraints: Communicate to partners and keep backward compatibility for N releases.
Desired Output Format: Obsoletion policy + sample ObsoleteState code + migration note. -
Role Assignment: Act as a semantic-versioning enforcer.
Task/Goal: Map code changes to version increments (major/minor/patch) and produce app.json update guidance.
Context/Constraints: Ensure compatibility guarantees are clearly documented.
Desired Output Format: Versioning matrix + PowerShell snippet to update app.json. -
Role Assignment: Act as a large-data migration specialist.
Task/Goal: Recommend patterns to migrate millions of records with minimal downtime.
Context/Constraints: Use batched background jobs, back-out strategy and integrity checks.
Desired Output Format: Stepwise migration plan + AL job queue snippet for batched migration. -
Role Assignment: Act as a release-readiness auditor.
Task/Goal: Run a checklist-based review of the pasted extension for production readiness (UCI checklist: security, performance, tests, docs, telemetry, permissions).
Context/Constraints: Provide pass/fail per item and remediation plan for failures.
Desired Output Format: Checklist with status + prioritized remediation tasks + code snippets for critical fixes.