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
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
What's your requirement exactly? If this is one-time update, you could consider configuring an on-demand process.
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
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:
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,280 Super User 2024 Season 2
Martin Dráb 230,214 Most Valuable Professional
nmaenpaa 101,156