Search code examples
c#dynamics-crmupsert

Dynamics CRM upsert request with related entities error


I am using MS Dynamics CRM 2016 On-Premises.

I am loading data through OrganizationService, using Upsert request.

screenshot

And I am getting an error:

Entity Id must be specified for Update

As I understood - related Campaign ([0] in RelatedEntities on screen) record does not exist and should be created during upsert, and wave record should be updated. But there isn't. What am I doing wrong?


Solution

  • Are you populating the Alternate Keys for that record? The record must have either an .Id or .KeyAttributes.

    From your screenshot the .Id is an empty Guid but not sure about the .KeyAttributes field.