AI and X++6 min read

Reviewing AI-generated X++ code: a 10-point checklist

Ten things to check before approving an AI-generated X++ pull request: extensions, BP check, security, performance, tests, naming, labels, deployment.

The short answer

AI-generated X++ code is reviewed like a developer's: through a pull request, with a fixed checklist. The ten points below follow the rules Microsoft documents for Dynamics 365 Finance & Operations. If one fails, the pull request goes back for rework: human approval keeps the final say.

The 10 points

  1. Extensions, never over-layering: standard tables, forms and classes are changed through extensions. See Chain of Command vs event handlers.
  2. Correct Chain of Command: next called at the first level, not inside an if or a loop; extension class marked final.
  3. Build and BP check with no unjustified warning. See BP check warnings.
  4. Security: every new menu item is covered by a privilege, linked to a duty and a role. See privilege, duty, role.
  5. Performance: set-based operations rather than loops, joins rather than nested selects, no query in a form's init. See insert_recordset and update_recordset.
  6. SysTest unit tests present, isolated (AutoRollback) and meaningful: they check the requested behaviour, not just that the code runs. See first SysTest test.
  7. Naming: solution prefix, conceptual names, no underscores in data entities, Entity suffix.
  8. Labels: all visible text in label files, no hard-coded strings.
  9. Extensibility and dependencies: small well-named methods, no new delegates, minimal model references, no doInsert/doUpdate bypassing events.
  10. Deployment: the package builds in the pipeline, database sync passes, and behaviour is checked on a test environment before production.

What AI misses most often

Without context, a model generates plausible but generic code: it ignores your prefixes, existing extensions, roles and data volumes. Points 4, 5, 7 and 9 are therefore the first to look at. Point 6 too: a test that always passes proves nothing. See what AI assistants can do in X++.

And at Skalp AI?

At Skalp AI, the agent generates the X++ code and its unit tests, compiles with a best-practice check, then pushes a pull request to the customer's Azure DevOps project with screenshots of the tests. Nothing reaches the working branch without the customer's technical architect reviewing and approving the pull request. See Azure DevOps integration, building X++ without a consultant in 2026 and the Basic, Pro and Max plans (1 credit, ≈ €400 on Basic, €200 on Pro, consumed only when the code is generated).

See also: AI ticket creation in D365 F&O.

Sources

Frequently asked questions

Who should approve AI-generated X++ code?

A developer or technical architect on the customer side, through the pull request, before any merge to the working branch.

Is the BP check enough to approve the code?

No. It catches known form and performance issues, but not a mismatch with the business need: you also need tests and a review.

Which points should you check first?

Security, performance, naming and dependencies: they depend most on your context and are what AI guesses least well.

Ready to transform your D365?

Join the CIOs who develop their D365 tickets in 2–4 h for 1 credit (≈ €400 on Basic, €200 on Pro).