d365fo_file
Create, modify, or generate D365FO AOT objects (classes, tables, forms, extensions) for X++ development, handling file writes and project integration.
Instructions
Create, modify, or generate a D365FO AOT object. Choose an action:
• create → write a NEW object file into PackagesLocalDirectory (UTF-8 BOM, auto-added to .rnrproj). THE WRITE STEP — incomplete until isError=false; ⚠️/❌ = failure. Extensions: objectName="Base.PrefixExtension".
• modify → edit an EXISTING object. APPLIES IMMEDIATELY, no dry-run — confirm with the user first; revert with undo_last_modification. Needs operation.
• generate → XML as TEXT only, no write (Azure/Linux fallback). Try create first. create/modify need Windows.
📖 Parameters are NOT inlined here: get_knowledge(kind="op-spec", topic=""|"") returns the contract for the one you picked — pass its values nested in params (modify) / properties (create), along with any packageName/packagePath/solutionPath/workspacePath override.
Model + prefix auto-applied. Classes: member vars inside the class { }, methods after the closing }.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| action | Yes | One of the three modes described above. | |
| params | No | [modify] Operation-specific parameters as ONE nested object, per get_knowledge(kind="op-spec", topic="<operation>"). A missing/wrong one returns that COMPLETE spec — follow it, do not guess. | |
| filePath | No | [modify] Absolute XML path — bypasses symbol-DB lookup. Use for objects just created. | |
| modelName | No | Target model — auto-detected. NEVER take it from search results (those are source models). | |
| operation | No | [modify] REQUIRED unless using operations[]. add-method also UPDATES in place; replace-code is the surgical oldCode→newCode path. Parameters: get_knowledge(kind="op-spec", topic="<operation>"). | |
| overwrite | No | Allow overwriting — never rewrite via PowerShell. | |
| objectName | No | Base name WITHOUT model prefix — the tool prepends it. Extension classes: "{Base}_Extension". NEVER hand-build the prefix. | |
| objectType | No | Each security/menu-item type is its own AOT folder — NEVER use security-privilege for duty or role. [modify]/[generate] cover the core families + their *-extension variants. | |
| operations | No | [modify] PREFERRED for 2+ edits to the SAME object — ONE call, not one per edit. Entries are {operation, …op-spec params}; objectType/objectName/modelName stay top-level. Applied in order, stopped at the first failure, per-operation results back. 3 fields + their field groups + an index: 7 calls flat, 1 here. | |
| properties | No | [create] Per-objectType creation properties (label, fields[], extends, enumValues[], primaryTable, …) — NOT in this schema. Fetch yours: get_knowledge(kind="op-spec", topic="<objectType>"). | |
| sourceCode | No | X++ source. FOR CLASSES auto-split: <Declaration> = class line + member vars; <Methods> = each method after the closing }. | |
| xmlContent | No | Complete XML written verbatim (+overwrite=true rewrites an object). | |
| projectPath | No | Path to .rnrproj (auto-detected). | |
| addToProject | No | Add to the ACTIVE .rnrproj — keep the default. | |
| createBackup | No | [modify] Back up before modifying. | |
| groundingToken | No | From prepare(change/create). Required for *-extension when GROUNDING_ENFORCE=true; object-bound. |