labels
Search label files, inspect translations, and create, update, or rename D365 F&O label texts across languages. Bulk-write missing entries with createIfMissing, removing search-then-create.
Instructions
Unified label operations — read and write. Writing an object? d365fo_file create/modify already turn a raw-text label/fieldLabel into a real @Ref by themselves; no call here is needed. Choose an action:
• search → full-text query across indexed label files. Never needed before a create.
• info → all translations for a labelId; without labelId lists label files (with labelFileId: physical .label.txt path per language).
• create → add a label to an AxLabelFile across every language .label.txt (write). ALWAYS pass createIfMissing=true: it creates when absent and reuses when present, so this ONE call replaces search-then-create. Bulk: labels:[{labelId, translations}, …] with shared labelFileId/model at top level does a whole object in one call. Label IDs describe MEANING — never a model prefix; target the model's ORIGINAL label file, never an …_Extension… one.
• update → overwrite the text of an EXISTING label; same args as create with corrected translations[] (write).
• rename → rename a label ID across .label.txt + X++ + XML + index. Use dryRun=true first (write).
Write plumbing (paths, languages, sortLabels, allowExtensionLabelFile…) is auto-resolved; override it via get_knowledge(kind="op-spec", topic="labels").
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| model | No | [search|info|create|update|rename] Model that owns the label file (e.g. ContosoExt). | |
| query | No | [search] REQUIRED. Search text — matches label ID, text and developer comment. ARRAY = try several phrasings in ONE call. | |
| action | Yes | ||
| dryRun | No | [rename] Preview changes without writing anything. | |
| labels | No | [create] Bulk mode — shared fields stay at the top level (top-level labelId/translations are then ignored); a failed entry does not abort the batch. | |
| params | No | Optional write plumbing — the auto-resolved overrides named at the end of the description above. | |
| labelId | No | [info] Label ID, any spelling: SYS67433, @SYS67433, @ContosoExt:MyLabel (paste search output). labelFileId/model optional. Omit to list label files. | |
| verbose | No | [search] Default one line per label; true = full multi-line block. | |
| language | No | [search] Language/locale (default: en-US). Examples: cs, de, sk. | |
| maxResults | No | [search] Max labels listed (default 10); a truncated set reports how many more matched. | |
| newLabelId | No | [rename] REQUIRED. New label ID. | |
| oldLabelId | No | [rename] REQUIRED. Current label ID (e.g. MyOldField). | |
| labelFileId | No | [search|info|create|update|rename] AxLabelFile ID (e.g. ContosoExt, SYS). For a NEW label file this ID is the MODEL name, never the bare EXTENSION_PREFIX. | |
| translations | No | [create] REQUIRED for single-label create (omit when using labels[]). Translations for each language. Provide at least en-US. |