Answered by:
How to create Business Unit in CRM 2011 through Plugin ?

Question
-
Hello,
I want to create Business Unit in CRM 2011 through Plugin. Is this possible ?
Please let me know how to achieve this.
Any response would be appreciable.
- Edited by DynamicsCRM31 Monday, March 3, 2014 6:05 AM
Monday, March 3, 2014 6:05 AM
Answers
-
Hi,
Business unit entity is accessible via IOrganizationService just like any other entity like account / contact. Hence the code will be exactly similar to access for account / contact. Here is the MSDN reference for what methods are available for BusinessUnit entity:
http://msdn.microsoft.com/en-us/library/gg309552.aspx
Also here is the reference for how to use create for account. For Business unit, instead of account you will call business unit entity.
http://msdn.microsoft.com/en-us/library/microsoft.xrm.sdk.iorganizationservice.create.aspx
Hope this helps.
-----------------------------------------------------------------------
Minal Dahiya
blog : http://minaldahiya.blogspot.com.au/
If this post answers your question, please click "Mark As Answer" on the post and "Vote as Helpful"- Proposed as answer by HIMBAPModerator Monday, March 3, 2014 7:05 AM
- Marked as answer by DynamicsCRM31 Tuesday, March 4, 2014 10:22 AM
Monday, March 3, 2014 6:33 AM -
Hi,
you can create business using SDK, check business unit metada and pass required information to create method.
HTH
Our Website | Our Blog | Follow US | My Facebook Page | Microsoft Dynamics CRM 2011 Application Design
Make sure to "Vote as Helpful" and "Mark As Answer",if you get answer of your question.- Proposed as answer by HIMBAPModerator Monday, March 3, 2014 7:05 AM
- Marked as answer by DynamicsCRM31 Tuesday, March 4, 2014 10:22 AM
Monday, March 3, 2014 6:35 AMModerator -
I expect it is possible to create a BU in a plugin, but this can be a data intensive operation, so might cause a timeout. If I had to do this, I'd probably configure the plugin to run asynchronously
However, it seesm strange to create a BU in a plugin. Creating a BU has little effect intil you add users to the BU, which I would have though would require manual intervention
Microsoft CRM MVP - http://mscrmuk.blogspot.com/ http://www.excitation.co.uk
- Marked as answer by DynamicsCRM31 Tuesday, March 4, 2014 10:21 AM
Monday, March 3, 2014 1:35 PMModerator
All replies
-
Hi,
Business unit entity is accessible via IOrganizationService just like any other entity like account / contact. Hence the code will be exactly similar to access for account / contact. Here is the MSDN reference for what methods are available for BusinessUnit entity:
http://msdn.microsoft.com/en-us/library/gg309552.aspx
Also here is the reference for how to use create for account. For Business unit, instead of account you will call business unit entity.
http://msdn.microsoft.com/en-us/library/microsoft.xrm.sdk.iorganizationservice.create.aspx
Hope this helps.
-----------------------------------------------------------------------
Minal Dahiya
blog : http://minaldahiya.blogspot.com.au/
If this post answers your question, please click "Mark As Answer" on the post and "Vote as Helpful"- Proposed as answer by HIMBAPModerator Monday, March 3, 2014 7:05 AM
- Marked as answer by DynamicsCRM31 Tuesday, March 4, 2014 10:22 AM
Monday, March 3, 2014 6:33 AM -
Hi,
you can create business using SDK, check business unit metada and pass required information to create method.
HTH
Our Website | Our Blog | Follow US | My Facebook Page | Microsoft Dynamics CRM 2011 Application Design
Make sure to "Vote as Helpful" and "Mark As Answer",if you get answer of your question.- Proposed as answer by HIMBAPModerator Monday, March 3, 2014 7:05 AM
- Marked as answer by DynamicsCRM31 Tuesday, March 4, 2014 10:22 AM
Monday, March 3, 2014 6:35 AMModerator -
Thanks for your references.
I thought BU can not and should not be created through Plugin (Back-end code).
I will check for this.
Thanks.
If this post answers your question, please click "Mark As Answer" on the post and "Mark as Helpful"
Monday, March 3, 2014 6:46 AM -
Can you be specific ?
means what are minimum related entity is required to create a new BU ?
If this post answers your question, please click "Mark As Answer" on the post and "Mark as Helpful"
Monday, March 3, 2014 7:49 AM -
I expect it is possible to create a BU in a plugin, but this can be a data intensive operation, so might cause a timeout. If I had to do this, I'd probably configure the plugin to run asynchronously
However, it seesm strange to create a BU in a plugin. Creating a BU has little effect intil you add users to the BU, which I would have though would require manual intervention
Microsoft CRM MVP - http://mscrmuk.blogspot.com/ http://www.excitation.co.uk
- Marked as answer by DynamicsCRM31 Tuesday, March 4, 2014 10:21 AM
Monday, March 3, 2014 1:35 PMModerator -
I agree with you David.
I need to explain this to my Client .
If this post answers your question, please click "Mark As Answer" on the post and "Mark as Helpful"
Tuesday, March 4, 2014 10:21 AM