Answered by:
Bulk Delete with REST and Plugins (CRM 2011) + REST v/s Plugins

Question
-
Experts,
Would appreciate your feedback on this:
"Can we do bulk delete (one server) call and delete all the data in a particular entity through REST" (using JSON)?
- Edited by itsgonabeme Wednesday, July 6, 2011 8:45 AM
Tuesday, July 5, 2011 9:46 AM
Answers
-
no you can't do that becase delete method takes id of the record as a parameter, so you have to call this method either in loop or need to call it one by one for particular id
refer http://technet.microsoft.com/en-us/library/microsoft.xrm.sdk.iorganizationservice.delete.aspx
Mahain : My Dynamics CRM Blog- Proposed as answer by HIMBAPModerator Wednesday, July 6, 2011 5:59 AM
- Marked as answer by itsgonabeme Wednesday, July 6, 2011 8:43 AM
Tuesday, July 5, 2011 2:15 PMModerator -
No you can't do that even in plugin because in plugin you will use the same method.
Mahain : My Dynamics CRM Blog- Proposed as answer by HIMBAPModerator Wednesday, July 6, 2011 5:59 AM
- Marked as answer by itsgonabeme Wednesday, July 6, 2011 8:43 AM
Wednesday, July 6, 2011 5:59 AMModerator -
Hi,
As you want to develop a product I will suggest you to implement your business logic with plugin, and use js only for form validatons.
and why we should go for plugin, here it is already answered.
Mahain : My Dynamics CRM Blog- Proposed as answer by HIMBAPModerator Wednesday, July 6, 2011 8:39 AM
- Marked as answer by itsgonabeme Wednesday, July 6, 2011 8:43 AM
Wednesday, July 6, 2011 8:39 AMModerator
All replies
-
no you can't do that becase delete method takes id of the record as a parameter, so you have to call this method either in loop or need to call it one by one for particular id
refer http://technet.microsoft.com/en-us/library/microsoft.xrm.sdk.iorganizationservice.delete.aspx
Mahain : My Dynamics CRM Blog- Proposed as answer by HIMBAPModerator Wednesday, July 6, 2011 5:59 AM
- Marked as answer by itsgonabeme Wednesday, July 6, 2011 8:43 AM
Tuesday, July 5, 2011 2:15 PMModerator -
Thanks Mahendar, appreciate your feedback.
Can i do bulk delete (one server call) with PLUGINS, or any other possible way you can think.
I am still learning so any help or reference would be great.
Kind Regards,
Tuesday, July 5, 2011 10:29 PM -
No you can't do that even in plugin because in plugin you will use the same method.
Mahain : My Dynamics CRM Blog- Proposed as answer by HIMBAPModerator Wednesday, July 6, 2011 5:59 AM
- Marked as answer by itsgonabeme Wednesday, July 6, 2011 8:43 AM
Wednesday, July 6, 2011 5:59 AMModerator -
Thanks again Mahender for the info on Plugin.
One last question before i close this thread and mark all of your answers + also you are an MVP so would appreciate your input or any knowledge base you can provide.
We are planning to build a product mostly it will be just the basic routine stuff. But for the parts where we have to add/update/delete stuff in the child table or in other words populate data behind the scenes which approach (Rest or Plugins) would you recommend and why, i have done experiments on REST and its messy but again that's just me a rookie in CRM 2011, but again coming back to that question for longer term since this is or will be product what we shall go with and why + also would be great if you can share any info that would think can be helpful.
Looking forward for your feedback.
Kind Regards,
Wednesday, July 6, 2011 8:29 AM -
Hi,
As you want to develop a product I will suggest you to implement your business logic with plugin, and use js only for form validatons.
and why we should go for plugin, here it is already answered.
Mahain : My Dynamics CRM Blog- Proposed as answer by HIMBAPModerator Wednesday, July 6, 2011 8:39 AM
- Marked as answer by itsgonabeme Wednesday, July 6, 2011 8:43 AM
Wednesday, July 6, 2011 8:39 AMModerator -
Thank you! Excellent link
Everything is crystal clear now..
Wednesday, July 6, 2011 8:44 AM