dataverse-web-api

Installation
SKILL.md

Dataverse Web API — Metadata & Schema

CRITICAL RULES

  1. Always pass MSCRM.SolutionUniqueName header when creating any component. Without it, components land in the Default Solution with the environment's random default publisher prefix (e.g., cr8a3_mytable). The schema name is permanently baked with that random prefix. The component cannot be packaged into a deployable solution without being manually re-added — and it cannot be renamed.

  2. Column (Attribute) creation MUST include correct @odata.type. Omitting or using the wrong type causes a 400 error with no helpful message. Example: "@odata.type": "Microsoft.Dynamics.CRM.StringAttributeMetadata". See resources/columns-attributes.md for all valid types.

  3. Every POST /EntityDefinitions MUST include a StringAttributeMetadata with IsPrimaryName: true. The Attributes array inline in the table creation body must contain exactly one primary name attribute. Omitting it causes a 400.

  4. Metadata PUT requires the FULL definition — partial updates silently zero unspecified properties. The API returns 204 (success) when you send a partial payload, but every property you omit is cleared to its default. Always GET the current definition first, modify the specific properties, then PUT the complete object. Add MSCRM.MergeLabels: true header on PUT to preserve labels in other languages.

  5. Add Consistency: Strong header when reading metadata immediately after writing. Without it, GET EntityDefinitions may return a stale cached response, causing you to wrongly conclude a write failed or overwrite just-written values.

  6. FormXml and LayoutXml must stay in sync with FetchXml. Every column in a view's layoutxml MUST appear in its fetchxml. Mismatches cause silent runtime errors at view render time — the API accepts the write, the error only appears to users when loading the view.

  7. Publishing is required after updating existing definitions — not after creating new ones. New tables and columns auto-publish. Updating existing forms, views, sitemaps, or ribbons requires explicit PublishXml. Use scoped publish: <entities><entity>logicalname</entity></entities>. PublishAllXml causes visible latency spikes for all users — avoid in production.

  8. Windows: Always use PowerShell .ps1 for OData API calls. Bash interprets $filter, $select, $expand, $orderby as shell variables and silently strips them. Write .ps1 files, run with powershell -ExecutionPolicy Bypass -File.

Installs
1
GitHub Stars
4
First Seen
Jul 7, 2026