Skip to main content

Notifications

Microsoft Dynamics CRM (Archived)

Need to insert bulk data to Custom entity in plugin.

Posted on by 185

     var CustDetails = CustInfo.findAgentInfo("X", "003");
   
   //This CustDetails has nearly 5000 to 10000 records.These records i need to save to the "TestConactList"
   custom entity. The below code is working fine.
   but each time the service will excute and created record.
   I want one strecth need to create (bult insert in custom entity)


   Entity TestList = new Entity("TestConactList");
                        if (CustDetails != null)
                        {
                            foreach (var _CustInfo in CustDetails)
                            {
                               
                                TestList["name1"] = _CustInfo.name1.ToString();
                                TestList["address1"] = _CustInfo.addrs1.ToString();
                                TestList["address2"] = _CustInfo.addrs2.ToString();
                                TestList["zipcode"] = _CustInfo.zip.ToString();
                                TestList["city"] = _CustInfo.city.ToString();
                                TestList["accounttype"] = Accounttype;
                                TestList["Agent"] = new EntityReference("agent", AgentBroker.Id);
                                service.Create(TestList);
                            }
                        }

*This post is locked for comments

  • Suggested answer
    Kishor Kumar Profile Picture
    Kishor Kumar 3,702 on at
    RE: Need to insert bulk data to Custom entity in plugin.

    Hi

    Use executle multiple to upload the bulk of data

    Check this links

    msdn.microsoft.com/.../jj863631.aspx

    stackoverflow.com/.../dynamics-crm-sdk-execute-multiple-requests-for-bulk-update-of-around-5000-recor

  • Suggested answer
    a33ik Profile Picture
    a33ik 84,323 Most Valuable Professional on at
    RE: Need to insert bulk data to Custom entity in plugin.

    Hello,

    You should consider usage of ExecuteMultipleRequest/ExecuteMultipleResponse - msdn.microsoft.com/.../jj863631.aspx

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