Skip to content

[Bug] add-dataverse-api fails with 404 when action has mscrm.crmbaseentity parameter #319

@Finance455

Description

@Finance455

Description

Running add-dataverse-api on any action that has a parameter of type
mscrm.crmbaseentity fails with a 404 error. The CLI attempts to fetch
the entity definition for crmbaseentity from the Dataverse metadata API,
but crmbaseentity is an abstract base type — not a real table — so the
API returns 404.

Steps to Reproduce

  1. Initialize a Power Apps code app with npx power-apps init
  2. Run the following:

Failed to get entity definition for table 'crmbaseentity' from organization

'https://[YOUR-ORG].api.crm4.dynamics.com': HTTP error status: 404 for GET
https://[YOUR-ORG].api.crm4.dynamics.com/api/data/v9.0/EntityDefinitions
(LogicalName='crmbaseentity')?$select=MetadataId,LogicalName,DisplayCollectionName,
DisplayName,EntitySetName,Description,HasNotes,IsActivity,IsIntersect,IsManaged,
TableType,IsPrivate,IsLogicalEntity,PrimaryIdAttribute,PrimaryNameAttribute,
ObjectTypeCode,OwnershipType,Privileges,IsAvailableOffline,IsOfflineInMobileClient
&$expand=Attributes,ManyToOneRelationships,OneToManyRelationships,ManyToManyRelationships

Why It Happens

AddToQueue has a parameter Target: mscrm.crmbaseentity. The CLI tries
to fetch the schema for crmbaseentity like any other entity, but per
Microsoft's own documentation, crmbaseentity is defined as:

<EntityType Name="crmbaseentity" Abstract="true" />

It has no real table definition and no EntityDefinitions entry in the API.
The CLI should detect abstract types and skip the schema fetch, falling back
to Record<string, unknown> as documented.

Affected Actions

Any action with mscrm.crmbaseentity parameters is affected. Confirmed:

  • AddToQueue (Target: mscrm.crmbaseentity)
  • GrantAccess (Target: mscrm.crmbaseentity)
  • Likely also: Merge, RetrievePrincipalAccess, InitializeFrom, and others

Working vs Broken

  • npx power-apps add-dataverse-api --api-name WhoAmI → works (no entity params)
  • npx power-apps add-dataverse-api --api-name AddToQueue → fails (crmbaseentity param)

Expected Behavior

The CLI should recognize crmbaseentity as an abstract base type, skip the
entity definition lookup, and map it to Record<string, unknown> in the
generated TypeScript service — which is exactly what the documentation already
says this type maps to.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions