Skip to content

Commit cfc2056

Browse files
tpellissierclaude
andcommitted
Fix UpsertMultiple: don't merge alternate key fields into request body
Alternate key values must only appear in @odata.id, not in the record body. Including them in both causes Dataverse to return 400 Bad Request. Confirmed via raw curl that removing the duplicate fields resolves it. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent e77531a commit cfc2056

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/PowerPlatform/Dataverse/data/_odata.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,7 @@ def _upsert_multiple(
460460
}
461461
if conflicting:
462462
raise ValueError(f"record payload conflicts with alternate_key on fields: {sorted(conflicting)!r}")
463-
combined: Dict[str, Any] = {**alt_key_lower, **record_processed}
463+
combined: Dict[str, Any] = dict(record_processed)
464464
if "@odata.type" not in combined:
465465
combined["@odata.type"] = f"Microsoft.Dynamics.CRM.{logical_name}"
466466
key_str = self._build_alternate_key_str(alt_key)

0 commit comments

Comments
 (0)