Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

BulkUpdate using plugin.

Posted on by

I need to update more than 100 records using plugin in CRM 2011.What will be best approach for implementing it?

Any help will be very much appreciated.

Thanks,

Gitanjali

*This post is locked for comments

  • Suggested answer
    Karth Profile Picture
    Karth on at
    RE: BulkUpdate using plugin.

    What's your requirement exactly? If this is one-time update, you could consider configuring an on-demand process.

  • Suggested answer
    ScottDurow Profile Picture
    ScottDurow 50,177 on at
    RE: BulkUpdate using plugin.

    Hi,

    When you say 'using a plugin' - I presume that means that there is some user initiated action that results in a plugin firing (say a record update?) - if this is the case you will be able to perform your updates in the plugin transaction using the IOrganizationService passed to the plugin context - however you need to be aware of the request timeout. If your updates are going to be taking more than 1-2 minutes , then I wouldn't suggest this option of using a plugin transaction because you will hit this limit (see msdn.microsoft.com/.../gg327941.aspx and social.technet.microsoft.com/.../12601.crm-2011-timeouts-and-limits.aspx)

    It might be better to create a Custom Workflow activity that does the updates since workflows are not subject to the same request/sandbox plugin timeouts.

    You also might consider moving your updates to a client batch process if it doesn't need to run on the CRM server triggered by a user and is only run infrequently. If you are using a batch process that isn't running on the server you could use ExecuteMultiple to submit a batch of updates in one request - msdn.microsoft.com/.../jj863631.aspx

    Other options are a manual export to excel and mark for reimport.

    Hope this helps,

    Scott

  • Suggested answer
    Hosk Profile Picture
    Hosk on at
    RE: BulkUpdate using plugin.

    Why do you need to update 100 records using a plugin, could you do this just using a console app or will you need to update 100 records on a regular basis.

    if you wrote a console app you could trigger this to run outside working hours so it would have no effect on performance.

    I would say updating 100 records isn't very much so I don't think you need to worry about performance

    If I was to do this in a plugin  I would do it so it ran Asynchronously.  this means it would run a bit like a workflow and would be scheduled by CRM to run when it has the resource and unlike synchronous plugins it would not make any records wait until it's finished.

    this forum had a similar discussion and the points below are valid

    social.microsoft.com/.../synchronous-plugin-vs-asynchronous-plugin

    Plug-ins registered for synchronous processing execute immediately, whereas plug-ins registered for asynchronous processing are queued.

    That means in case of synchronous plugin the platform core operation need to wait for the completion of plugin execution.

    so you can get better performance by registering a plugin to execute asynchronously.

    But when , to opt for an aync registration depends on your  requirements.

    Go through the below links for better understanding:

    www.devx.com/.../1954

    msdn.microsoft.com/.../cc151086.aspx

    msdn.microsoft.com/.../cc150926.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!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans