Skip to main content

Notifications

Customer experience | Sales, Customer Insights,...
Unanswered

CRM Web API Batch/Bulk operation when upsert is disabled

Posted on by 10

Hi community,

we're using CRM Web API Batch operation to transfer data from an external system A to client's CRM. To make it as fast as possible we send the maximum 100 records in one HttpPost via CRM Web API. All updates were supposed to be updates, no inserts.

After a few moments we discovered that Web API does an upsert by default so that false GUIDs from System A gets created in CRM. Not good. We added header "If-Match: *" and this fixed our problem, only updates to existing records are allowed. All good thus far.

After few more moments we discovered that not all updates from System A were sent to CRM. Debug logging revealed that all those 100 records HttpPost chunks having a single non-existing GUID were discarded. Not good.

I tried to look how to gain a header set where all valid (99pcs 204's) updates would be accepted and only the non-existent records would be failed (1pc 404). https://docs.microsoft.com/en-us/powerapps/developer/common-data-service/webapi/perform-conditional-operations-using-web-api

Anyone know a way out of this?

BR, Timo

Trying avoid this: The other way is to process the answer and remove the offending GUID away from the original send.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,240 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,149 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans