validate_code
Validate generated X++/XML code by checking syntax, best-practice rules, and semantic references to ensure correct metadata before writing.
Instructions
Static validator for generated X++/XML (paste the text). Choose a mode:
• syntax → offline best-practice/BP validator (no xppbp.exe). Structured violations {rule, severity, line, excerpt, fix}. Covers select, CoC, BP and table-XML rules mined from standard models.
• references → semantic reference resolver (index-only): verifies every type, field, method (incl. arity), enum, label and intrinsic (tableStr/fieldStr/…) EXISTS in the indexed codebase. codeType="xml-table" checks XML refs instead: EDT/enum/relation/extends/label.
Call mode="both" AFTER generating, BEFORE writes; fix errors in the same turn. Write tools run references internally when GROUNDING_ENFORCE=true.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | X++ source code or XML metadata to validate. Paste the full generated text. | |
| mode | Yes | both = run the two checks in ONE call (preferred). | |
| context | No | Optional: owning class/table name, used in diagnostic messages. | |
| codeType | No | [syntax] "xpp" X++ (default), "xml-table" AxTable, "xml-form" AxForm(+Extension), "xml-report" AxReport, "xml-any" other. | xpp |