/trud-d365fo-xpp:d365-xpp-xreffrom D365FO X++ Development
Queries the D365 F&O cross-reference database (DYNAMICSXREFDB) to find where X++ elements are used. Use instead of grepping XML for fast impact analysis, reference lookups, and Chain of Command extension discovery.
Ships in D365FO X++ Development. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Visual Studio's Find references reads the cross-reference database that the X++ compiler fills during a build (DYNAMICSXREFDB on the local SQL Server of a development VM). Querying it directly answers "who uses this?" in seconds and in a few lines of output, where searching the XML of a ~19k-table application would take minutes and thousands of tokens. Prefer it to Grep over PackagesLocalDirectory for any usage question.
<skill-dir>\scripts\Find-XppReference.ps1 runs the query and prints a compact tab-separated report. It's read-only and uses Windows authentication.
/Tables/SalesLine/Fields/SalesPrice.-FindPath. Names in the database don't always match the AOT casing, and a typo returns nothing.-SourceModule, -SourceType, -Kind). Start with the default -GroupBy Object, which returns one row per referencing element and costs the fewest tokens.-GroupBy Member for the methods, -GroupBy None for every reference with its line and column. Then open just the source files you need.Before writing a Chain of Command method, run -ExtensionsOf on the class, table or form you extend, filtered to the user's model (-SourceModule ContosoCustomizations). If the model already has an [ExtensionOf] class for it, add the method to that class instead of creating a second extension class for the same element. Projects usually keep one extension class per element and model.
Windows PowerShell 5.1. From the PowerShell tool:
& "<skill-dir>\scripts\Find-XppReference.ps1" -Target /Tables/SalesLine/Fields/SalesPrice -SourceModule ApplicationSuite -SourceType Classes
From Bash, or if the execution policy blocks scripts:
powershell.exe -NoProfile -ExecutionPolicy Bypass -File "<skill-dir>/scripts/Find-XppReference.ps1" -Target /Tables/SalesLine/Fields/SalesPrice -SourceType Classes
| Parameter | Meaning |
|---|---|
-Target <path> | Element to find references to. Matched exactly, unless it contains * or % (wildcards). |
-FindPath <pattern> | Instead of references, list matching element paths and their module, e.g. '/Tables/SalesLine/Fields/Sales*'. |
-ExtensionsOf <path> | Instead of references, list the [ExtensionOf] classes of a class, table or form, e.g. /Classes/SalesLineType, /Tables/SalesTable, /Forms/SalesTable. A form path also returns its data source and control extensions; /Forms/SalesTable* shows which part each one extends (column Extends). Combine with -SourceModule. |
-SourceModule <name> | Only references from code in this module (model), e.g. ApplicationSuite, ContosoCustomizations. Wildcards allowed. |
-SourceType <segment> | Only references from this element type: the first path segment, e.g. Classes, Tables, Forms, DataEntityViews. |
-Kind <kind> | Only one reference kind (table below). Default Any. |
-GroupBy Object|Member|None | Object (default): type, object, module, count. Member: adds the method and its first line. None: one row per reference with full source path, line, column, kind. |
-Top <n> | Row limit, default 500. The header says when the limit was hit. |
-Server, -Database | Default . and DYNAMICSXREFDB. |
Output: a summary line with the row count, then a tab-separated header and rows. Exit codes: 0 rows found, 1 nothing found, 2 connection or query failure.
Paths are /<Type>/<Object>[/<MemberType>/<Member>]. Common forms:
| Element | Path |
|---|---|
| Table / class / form | /Tables/SalesLine, /Classes/SalesLineType, /Forms/SalesTable |
| Table field | /Tables/SalesLine/Fields/SalesPrice |
| Table or class method | /Tables/SalesLine/Methods/insert, /Classes/SalesLineType/Methods/validateWrite |
| Class member variable | /Classes/SalesLineType/Fields/salesLine |
| EDT / enum | /Edts/SalesPrice, /Enums/SalesStatus |
For anything else, find the form with -FindPath '/<Type>/<Object>*'.
| Kind | Meaning |
|---|---|
MethodCall (1) | Method call, or use of a class member variable |
TypeReference (2) | Use of a type or a table field: declarations, field reads and writes, select statements |
InterfaceImplementation (3) | Class implements the target interface |
ClassExtended (4) | Class extends the target class |
Property (6) | Metadata property reference, e.g. /Property/IsDelegate |
Attribute (7) | Attribute applied, including ExtensionOf. The target is the attribute class (/Classes/ExtensionOf), not the extended element |
Tag (9) | Test tags |
MethodOverride (10) | Method overrides the target method |
Example: the direct subclasses of a class are -Target /Classes/RunBase -Kind ClassExtended; the overrides of one of its methods are -Target /Classes/RunBase/Methods/dialog -Kind MethodOverride.
[ExtensionOf(classStr(SalesLineType))] is stored as two references on the attribute's line: an Attribute reference to /Classes/ExtensionOf and a TypeReference to /Classes/SalesLineType. So -Target /Classes/SalesLineType -Kind Attribute finds nothing; use -ExtensionsOf, which matches both.
TypeReference. To tell them apart, use -GroupBy None and open the reported lines./Classes/Runbase). Matching is case-insensitive, so this only matters when you compare the output with file names./Forms/<Form>/... or /Tables/<Entity>/.... Use -SourceType Classes when only X++ class code matters./Tables/CustTable, or a wildcard) can return tens of thousands of references. Keep -GroupBy Object and add filters instead of raising -Top.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
dynamics-365, x++, cross-reference, impact-analysis, find-references
npx claudepluginhub trudax/d365fo-xpp-skills --plugin trud-d365fo-xpp5 skills in this plugin
/d365-xpp-compileSet up the task's Visual Studio project and git branch, then build a Dynamics 365 Finance & Operations (D365 F&O, AX7) X++ project (.rnrproj) from the command line the way Visual Studio does on a development VM (CHE or VHD) - compile its package with xppc into PackagesLocalDirectory, compile labels, sync changed tables and data entities, restart the AOS so the change can be tested - and analyse the compile errors. Use this at the start of every task that will create or modify X++ / AOT elements (AxClass, AxTable, AxForm, table/form/class extensions, EDTs, enums, menu items, data entities, security, labels), before the first edit - to create or find the task's project and branch - and after the changes - add the changed elements to the project, build, and fix errors until the build is clean, without waiting to be asked. Also use when the user says "build/compile the project", "deploy it so I can test", "check that it compiles", "run xppc", or pastes X++ compiler errors./d365-xpp-conventionsConventions for creating Dynamics 365 Finance & Operations (D365 F&O, AX7) X++ elements as metadata XML - new tables and table fields, EDTs, table relations, setup forms (simple list, list and details with a tabular grid), RunBase dialog and batch classes, table/form/enum extensions, Chain of Command and event handler classes, menu items and security privileges. Use this before writing the XML whenever you create a table, add fields to a table or table extension, create a form, an extension or extension class, a RunBase/RunBaseBatch class or other periodic operation, a menu item or a privilege - even when the user only says "create a table for X", "add a field", or "make a job that updates Y"./d365-xpp-extensionsRules and recipes for extending standard Dynamics 365 Finance & Operations (D365 F&O, AX7) X++ code from your own model - Chain of Command wrappers ([ExtensionOf], next), pre/post, data-event and form event handlers, delegate subscribers, form, data source and control extensions, lookups (control, field, reference group, multi-select) and fields added to RunBase or SysOperation dialogs. Use this before writing or reviewing any [ExtensionOf] class or event handler class, and whenever the task changes, blocks or adds to standard behaviour - "add a check before posting", "default this field on the sales line", "filter this lookup", "add a field to this dialog", "hide this button on the form", "why is my extension not called", "review this extension" - even when the user doesn't say Chain of Command, CoC or extension./d365-xpp-trace-parserRead a Dynamics 365 Finance & Operations (D365 F&O, AX7) trace that was imported into a Trace Parser SQL database and link it to the X++ code - which SQL statement wrote a value, the actual bind values of every insert and update, the call stack of a statement, and which methods ran in what order. Use this when the user has captured a trace (Settings > Trace, Trace Parser, an .etl file) and asks why a field got a value, which code created or changed a record, what a batch job or wave run did, or to "read the trace", "the trace is imported into the database", "find in the trace where X was set", "link the trace to the X++ logic".