RetrieveSubsidiaryTeamsBusinessUnit Message (CrmService)

banner art

[Applies to: Microsoft Dynamics CRM 4.0]

Find the latest SDK documentation: CRM 2015 SDK

Works for all deployment types Works online and offline

Retrieves all team information from the child business units of the specified business unit.

The relevant classes are specified in the following table.

Type Class
Request RetrieveSubsidiaryTeamsBusinessUnitRequest
Response RetrieveSubsidiaryTeamsBusinessUnitResponse
Entity businessunit

Remarks

To use this message, pass an instance of the RetrieveSubsidiaryTeamsBusinessUnitRequest class as the request parameter in the Execute method.

To perform this action, the caller must have access rights on the business unit entity instance. For a list of required privileges, see RetrieveSubsidiaryTeamsBusinessUnit Privileges.

Example

The following code example demonstrates how to use the RetrieveSubsidiaryTeamsBusinessUnit message.

[C#]
// Set up the CRM service.
CrmAuthenticationToken token = new CrmAuthenticationToken();
// You can use enums.cs from the SDK\Helpers folder to get the enumeration for Active Directory authentication.
token.AuthenticationType = 0; 
token.OrganizationName = "AdventureWorksCycle";
 
CrmService service = new CrmService();
service.Url = "http://<servername>:<port>/mscrmservices/2007/crmservice.asmx";
service.CrmAuthenticationTokenValue = token;
service.Credentials = System.Net.CredentialCache.DefaultCredentials;

// Create the request object.
RetrieveSubsidiaryTeamsBusinessUnitRequest retrieve = new RetrieveSubsidiaryTeamsBusinessUnitRequest();

// Set the properties of the request object.
// Be aware that using AllColumns may adversely affect
// performance and cause unwanted cascading in subsequent 
// updates. A best practice is to retrieve the least amount of 
// data required.
retrieve.ColumnSet = new AllColumns();

// Specify the GUID of the business unit whose subsidiary teams are being retrieved.
retrieve.EntityId = new Guid("18ECA720-493E-4800-BBFD-638BD54EB325");

// Execute the request.
RetrieveSubsidiaryTeamsBusinessUnitResponse retrieved = (RetrieveSubsidiaryTeamsBusinessUnitResponse)service.Execute(retrieve);

[Visual Basic .NET]
' Set up the CRM service.
Dim token As New CrmAuthenticationToken()
' You can use enums.cs from the SDK\Helpers folder to get the enumeration for Active Directory authentication.
token.AuthenticationType = 0
token.OrganizationName = "AdventureWorksCycle"
 
Dim service As New CrmService()
service.Url = "http://<servername>:<port>/mscrmservices/2007/crmservice.asmx"
service.CrmAuthenticationTokenValue = token
service.Credentials = System.Net.CredentialCache.DefaultCredentials

' Create the request object.
Dim retrieve As New RetrieveSubsidiaryTeamsBusinessUnitRequest()

' Set the properties of the request object.
' Be aware that using AllColumns may adversely affect 
' performance and cause unwanted cascading in subsequent 
' updates.  A best practice is to retrieve the least amount of 
' data required.
retrieve.ColumnSet = New AllColumns()

' Specify the GUID of the business unit whose subsidiary teams are being retrieved.
retrieve.EntityId = New Guid("18ECA720-493E-4800-BBFD-638BD54EB325")

' Execute the request.
Dim retrieved As RetrieveSubsidiaryTeamsBusinessUnitResponse = CType(service.Execute(retrieve), RetrieveSubsidiaryTeamsBusinessUnitResponse)

See Also

Concepts

Reference

© 2010 Microsoft Corporation. All rights reserved.