web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Answered

Update data in CRM in bulk

(3) ShareShare
ReportReport
Posted on by 700
Hi,
 
We have created a Windows tool to retrieve data from CRM, process it, and update it back in CRM. However, updating data in CRM is taking a long time since we are handling around 200K to 500K records.

Is there a faster way to update data in CRM while also handling service timeout issues?

Looking forward to your solution.

Thanks!
I have the same question (0)
  • Vahid Ghafarpour Profile Picture
    11,930 Super User 2025 Season 2 on at
    Update data in CRM in bulk
    If any of the responses helped resolve your issue, please take a moment to mark the best answer. This helps others in the community quickly find solutions to similar problems.

    To do this, simply click the "Does this answer your question?" button on the most helpful response and like the helpful posts. If your issue is still unresolved, feel free to provide more details so the community can assist further!

    Thanks for being an active part of the Dynamics 365 Community! 😊
  • Jonas "Jones" Melgaard Profile Picture
    4,825 Super User 2025 Season 2 on at
    Update data in CRM in bulk
    It depends on how often you plan to do this. Dataverse is just a REALLY SLOW database.
     
    At my former job, we found out that the the service protections is per licensed user account.. So another solution could be to split the update up in chunks and have a separate user per chunk.  You can also check this article, it's talking about benchmarking upserts: Dataverse: Bulk Performance Settings – Max Threads and Chunks – Temmy Wahyu Raharjo
     
    Is this a one-off task? If so then I have used ADF to do mass updates (100.000) using batch updates. However it will never be fast. Also disable plugins can help a bit.
     
     
  • Verified answer
    Daivat Vartak (v-9davar) Profile Picture
    7,827 Super User 2025 Season 2 on at
    Update data in CRM in bulk
    Hello Balasaheb,
     

    Handling updates for 200K to 500K records in Dynamics 365 CRM (now Dataverse) is a significant undertaking, and optimizing for speed and service timeout issues is crucial. Here's a breakdown of strategies to improve performance and reliability:

    1. Batch Processing:

    • Bulk Update:

      • Instead of updating records one by one, group them into batches.
      • The Dataverse Web API and SDKs support bulk update operations, which are significantly faster.
      • Aim for batch sizes that balance performance and potential timeout risks (e.g., 100-250 records per batch). 

    • ExecuteMultipleRequest (SDK):

      • If you're using the Dynamics 365 SDK, leverage the ExecuteMultipleRequest. This allows you to send multiple update requests in a single API call. 

    • Web API Batch Requests:

      • If using the Web API, use the $batch operation to send multiple requests in a single HTTP request.  

    2. Asynchronous Processing:

    • Queues:

      • Instead of updating records synchronously, queue the update operations.
      • Create a custom queue or use Azure Service Bus to store the update requests.
      • Use a background process (e.g., Azure Functions, console application) to process the queue and update the records. 

    • Benefits:

      • Prevents blocking your main application.
      • Allows for more resilient processing, as failed updates can be retried.
      • Reduces the load on the CRM server.  

    3. Optimize Data Retrieval and Processing:

    • Efficient Queries:

      • Ensure your initial data retrieval from CRM is optimized.
      • Use appropriate filters and indexes to minimize the amount of data retrieved. 

    • Minimize Data Transfer:

      • Retrieve only the necessary fields from CRM.
      • Avoid transferring large amounts of unnecessary data. 

    • Parallel Processing:

      • If possible, parallelize the data processing and update operations.
      • This can significantly reduce the overall processing time. 

    • Chunking:

      • If your data processing is heavy, divide the data into smaller chunks and process them separately.  

    4. Handle Service Timeouts and Errors:

    • Retry Logic:

      • Implement robust retry logic to handle transient errors and timeouts.
      • Use exponential backoff to avoid overwhelming the CRM server. 

    • Error Logging:

      • Log all errors and exceptions to a centralized logging system.
      • This helps with troubleshooting and monitoring. 

    • Circuit Breaker Pattern:

      • Implement the circuit breaker pattern to prevent repeated calls to a failing service.
      • This can help prevent cascading failures.  

    5. Optimize CRM Configuration:

    • Indexes:

      • Ensure that the fields you're updating are indexed.
      • This can significantly improve update performance. 

    • Asynchronous Plugins:

      • If you have any plugins that trigger on update, ensure they are asynchronous where possible. Asynchronous plugins will not delay the update action. 

    • Background Processes:

      • Minimize the number of synchronous background processes running on the CRM server.  

    6. Use the Correct API:

    • Web API vs. SDK:

      • The Dataverse Web API is generally recommended for performance, especially for bulk operations.
      • The SDK can be useful for more complex operations, but it can be slower for large-scale updates.  

    7. Monitor CRM Performance:

    • Performance Monitoring:

      • Monitor the performance of your CRM server during the update process.
      • Identify any bottlenecks or performance issues. 

    • Resource Usage:

      • Monitor CPU, memory, and disk usage on the CRM server. 

      •  

    Example Implementation Outline (PowerShell with Web API):

    # Retrieve data from CRM (optimized query)
    $crmData = Invoke-WebRequest -Uri "your_crm_api_url" -Headers $headers -Method Get | ConvertFrom-Json
    # Batch update CRM records
    $batchSize = 200
    for ($i = 0; $i -lt $crmData.value.Count; $i += $batchSize) {
        $batch = @()
        for ($j = $i; $j -lt ($i + $batchSize) -and $j -lt $crmData.value.Count; $j++) {
            $record = $crmData.value[$j]
            $updateRequest = @{
                "method" = "PATCH"
                "url" = "your_crm_api_url($($record.your_record_id))"
                "headers" = @{ "Content-Type" = "application/json" }
                "body" = ConvertTo-Json @{ "your_field" = "new_value" }
            }
            $batch += $updateRequest
        }
        # Send batch update request
        Invoke-WebRequest -Uri "your_crm_api_url/\$batch" -Headers $headers -Method Post -Body (ConvertTo-Json @{ "requests" = $batch })
        # Add retry logic and error handling here
    }

    By combining these strategies, you can significantly improve the performance and reliability of your CRM data update process. Remember to test thoroughly in a non-production environment before deploying to production.

     
    If my answer was helpful, please click Like, and if it solved your problem, please mark it as verified to help other community members find more. If you have further questions, please feel free to contact me.
     
    My response was crafted with AI assistance and tailored to provide detailed and actionable guidance for your Microsoft Dynamics 365 query.
     
    Regards,
    Daivat Vartak

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Andrés Arias – Community Spotlight

We are honored to recognize Andrés Arias as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
DAnny3211 Profile Picture

DAnny3211 134

#2
Daniyal Khaleel Profile Picture

Daniyal Khaleel 106

#3
Abhilash Warrier Profile Picture

Abhilash Warrier 70 Super User 2025 Season 2

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans