A C# integration sends UpsertRequest messages for supplier rows identified by an alternate key. For reporting, the code must count how many suppliers each run created and how many it updated. How can the code tell which happened for each request?
Select an answer to reveal the explanation.
Short Explanation
You don't have to play detective: the response just tells you. UpsertResponse carries a RecordCreated flag, true for a new row and false for an update. The other options are you trying to reverse-engineer an answer Dataverse hands you for free.
Full Explanation
UpsertResponse exposes a RecordCreated property that is true when the upsert inserted a new row and false when it updated an existing one, along with a Target entity reference that identifies the row either way. Counting creates and updates is therefore a matter of reading that Boolean for each response. Comparing IDs does not work, because the request identified the row by alternate key, often without any GUID, and the response's Target contains the row's ID in both cases. Row versions are maintained for every row and are not a signal of which operation occurred; their presence says nothing about create versus update. Upsert does not raise duplicate detection faults when a match exists; matching an existing row by key is the normal update path, and duplicate detection rules are a separate feature that does not apply to these requests. Exam caveat: in the Web API, an upsert sent with PATCH to a key-addressed URL returns 204 for both outcomes unless the request asks for the representation, so the SDK property is the simplest discriminator. Operational check: run the integration with one new supplier and one existing supplier, log RecordCreated for each response, and confirm the counts match what changed in the table.