Hi, Can we do bulk sharing using a plug-in. I have 1000's of records to be shared amoung 50 different peoples. I can't use security roles due to the business process, but this will be a list of users who need visibility on these records? Does sharing records in dynamics crm cause any performance impact or not considered as a best practices.
You should be able to do so with a plugin or workflow extension. Here's a project that will get you 90% there from code plex:
Thanks for the reply, but this code is still using a foreach statement for sharing the record one by one and sending separate request to CRM. In my case I have around 1000's of records which has to be shared with approximately 50 people each and if we use this approach, I might be sending ( 1000 * 50 ) separate request to CRM Service which isn’t great.
I think probably I might change my design approach if possible.
You can minimize the resource constraint by using a bulk request.
For example, putting 250 share request into one bulk request and use the SDK to execute the bulk request. This will reduce a lot of the network traffic.
for (i=0; i<5000; i+=250)
bulkrequest = new bulk request();
bulkrequest.add(new share request())
Is this requirement for Online or onPrem?
Will the 50 Users be based on a certain criteria or will it always be the same users?
If so maybe create a team and have them all assigned to the team then using a asyn plugin with a parallel foreach assign the records to the team.
Just use ExecuteMultipleRequest for bulk insertion: Link
What are you going to share?
Business Applications communities