Skip to content

v0.7.0 — bind Choice columns to a Global OptionSet

Choose a tag to compare

@rededis rededis released this 17 Aug 09:51
· 45 commits to main since this release

Added

  • add_attribute and create_entity accept global_option_set on a Picklist attribute, binding the column to an existing Global OptionSet by name instead of creating a private copy of the values (closes #60). Mutually exclusive with options; an unknown name fails as Global OptionSet not found: '<name>'.

    Global OptionSets exist so one choice list can be shared across columns and tables. Previously the only ways to get a shared list were to accept a local copy that silently drifts the first time anyone edits one of them, or to create the column by hand in the maker portal — which breaks an otherwise scripted schema workflow.

    create_entity resolves names and builds every attribute body before creating the table, so nothing a client-side check can reject — an unknown set name, a Picklist with no values, an impossible DateTime pairing — can leave a half-built table behind; Dataverse offers no transaction to roll one back. A name repeated across attributes costs one lookup, not one per column.

Changed

  • Reworded the tool descriptions for get_attribute_dependencies, delete_attribute, update_attribute and get_entity_schema. These are the always-loaded prompt text a model reads to decide whether to call a tool, so they are pruned rather than expanded: return shapes and component-type enumerations that a caller gets for free by calling are gone, each meaning now lives in one tool rather than being restated across several, and the rename/type-change recipe sits in update_attribute alone. No behavior change.

Notes

Three Web API details established live against a real org, all of which contradict the obvious reading:

  • The binding goes through the GlobalOptionSet navigation property, not an inline OptionSet. Sending an inline one with IsGlobal: true is rejected: 0x80048403 — Only Local option set can be created through the attribute create. IsGlobal flag must be set to 'false'.
  • The binding target must be the MetadataId. Microsoft's documentation states the alternate key by name — GlobalOptionSetDefinitions(Name='...') — works there too, but a real org answers HTTP 500: Guid should contain 32 digits with 4 dashes. Hence the name is resolved to a GUID first.
  • Sending an inline OptionSet and a binding together is not an error. Dataverse silently drops the binding and creates a local copy, which is why the pair is rejected client-side rather than left to the platform.