Document Attachments

Attach files to a record in D365FO — the DocuRef/DocuValue/DocuType tables, DocumentManagement::attachFile and its nine arguments, and reading an attachment back. Invoke when the user asks to attach a document, store a file against a record, read attachments, or debug an attachment that saved with the wrong name.

49 stars 26 forksAI, LLMs & Agents

Install

skills CLI (Claude Code, Cursor, Codex and more)
npx skills add dynamics365ninja/d365fo-cli --skill document-attachments
Manual install
git clone --depth 1 https://github.com/dynamics365ninja/d365fo-cli.git /tmp/d365fo-cli
mkdir -p ~/.claude/skills
cp -r /tmp/d365fo-cli/skills/anthropic/document-attachments ~/.claude/skills/document-attachments

Personal skills live in ~/.claude/skills. Use .claude/skills in a project folder to share a skill with your team.

From the SKILL.md

> ⛔ **NEVER write X++ AOT XML files directly** via PowerShell, terminal file commands (`Set-Content`, `Out-File`, `New-Item`), editor write tools, or any raw text approach. The XML schema is proprietary. **ALWAYS use `d365fo generate …` commands** to produce correct AOT XML. If `d365fo` is unavailable in PATH, stop and ask the user to install it.

# Document attachments

## The three tables, and which is which

An attachment is not one row. It is a row in each of two tables plus a
configuration row:

| Object | Kind | Holds |
|---|---|---|
| `DocuRef` | **table** | the link: which record the attachment belongs to, and its type |
| `DocuValue` | **table** | the file itself — content, name, extension |
| `DocuType` | **table** | the attachment TYPE: where files of this type are stored and how they behave |

`DocumentManagement` and `DocuAction` are **classes**; the three above are
**tables**. Reaching for `DocumentManagement` when you want the link row, or
treating `DocuRef` as a class, is the usual first wrong turn — check with
`d365fo get table DocuRef` and `d365fo get class DocumentManagement`.

A `DocuRef` points at its record by the trio `RefTableId` / `RefRecId` /
`RefCompanyId`. That is why attaching needs the table id and not the buffer:
the link is by identity, not by reference.

## Attaching a file

`DocumentManagement::attachFile` takes **nine** arguments, the last optional:
Read the full skill on GitHub

Details

Skill name
document-attachments
Path
skills/anthropic/document-attachments/SKILL.md
Repo updated
16 November 2026

FAQ

What does the Document Attachments skill do?

Attach files to a record in D365FO — the DocuRef/DocuValue/DocuType tables, DocumentManagement::attachFile and its nine arguments, and reading an attachment back. Invoke when the user asks to attach a document, store a file against a record, read attachments, or debug an attachment that saved with the wrong name.

How do I install the Document Attachments skill?

skills CLI (Claude Code, Cursor, Codex and more): npx skills add dynamics365ninja/d365fo-cli --skill document-attachments. Skills go in ~/.claude/skills (personal) or .claude/skills (project), and Claude loads them automatically when a task matches the description.

Is Document Attachments popular?

It lives in dynamics365ninja/d365fo-cli, which has 49 GitHub stars and 26 forks.

Related skills

Analytics and Er

49

dynamics365ninja/d365fo-cli

Model the D365FO analytical and document-generation surfaces — aggregate measurements and the entity store, tiles/cues and KPIs, and Electronic Reporting (ER). Invoke when the user asks about a workspace tile, a KPI, an aggregate measurement, the entity store, Power BI content, or running/binding an ER format.

Data & Analytics26

Barcode Scanning

49

dynamics365ninja/d365fo-cli

Barcodes and scanner input in D365FO — printing vs scanning are unrelated code paths, GS1-128 application identifiers, item-barcode resolution, and where the platform parses a scan for you. Invoke when the user mentions barcodes, GS1, GTIN, SSCC, scanning, scanners, item barcodes, or barcode setup.

AI, LLMs & Agents26

Build Error Triage

49

dynamics365ninja/d365fo-cli

Turn a D365FO compiler, best-practice, or runtime error into the specific fix it calls for. Invoke when the user pastes a build log, an xppc message, a BP violation, or an infolog stack trace and asks what it means or how to fix it.

AI, LLMs & Agents26

Event Handler Authoring

49

dynamics365ninja/d365fo-cli

Subscribe to a D365FO event (data event on a table, form / form-data-source / form-data-field event, custom delegate on a class) by scaffolding an event-handler class. Use when the user asks to "subscribe to an event", "react to inserted/deleted/updated", or "hook a delegate".

AI, LLMs & Agents26

Data Entity Scaffolding

49

dynamics365ninja/d365fo-cli

Scaffold an AxDataEntityView (data entity) in D365 Finance & Operations for OData / DMF (Data Management Framework) integration. Use when the user asks to "create a data entity", "expose a table to OData", or "scaffold an entity for DMF".

AI, LLMs & Agents26

Form Pattern Scaffolding

49

dynamics365ninja/d365fo-cli

Scaffold an AxForm in D365 Finance & Operations using one of the nine canonical patterns (SimpleList, SimpleListDetails, DetailsMaster, DetailsTransaction, Dialog, TableOfContents, Lookup, ListPage, Workspace), or create a Display / Action / Output menu item. Invoke whenever the user asks to "create a form", "scaffold a list page", "make a dialog", "build a workspace", "create a menu item", "add a Display menu item", or "add an Action menu item".

AI, LLMs & Agents26

Browse the most popular Claude skills, all ai, llms & agents skills, or write your own with the skills generator.