Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
RetrieveParentGroupsResourceGroup Message (CrmService)
Collapse the table of content
Expand the table of content

RetrieveParentGroupsResourceGroup Message (CrmService)

banner art

[Applies to: Microsoft Dynamics CRM 4.0]

Find the latest SDK documentation: CRM 2015 SDK

Works for all deployment typesWorks online and offline

Retrieves the collection of the parent resource groups of the specified resource group (scheduling group).

The relevant classes are specified in the following table.

TypeClass
RequestRetrieveParentGroupsResourceGroupRequest
ResponseRetrieveParentGroupsResourceGroupResponse
Entityresourcegroup

Remarks

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

To perform this action, the caller must have access rights on the resource group (scheduling group) entity instance. For a list of required privileges, see RetrieveParentGroupsResourceGroup Privileges.

Example

The following code example shows how to use the RetrieveParentGroupsResourceGroup 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.
RetrieveParentGroupsResourceGroupRequest request = new RetrieveParentGroupsResourceGroupRequest();
service sv = new service();

// Create the column set.
ColumnSet colSet = new ColumnSet();
colSet.Attributes = new string[] {"name", "resourcegroupid"};

// Set up the query.
request.Query = new QueryExpression();
request.Query.ColumnSet = colSet;
request.Query.EntityName = EntityName.resourcegroup.ToString();

// ResourceGroupId is the GUID of the resource group.
request.ResourceGroupId = new Guid("2B951FBC-1C56-4430-B23B-20A1349068F3");

// Execute the request.
RetrieveParentGroupsResourceGroupResponse response = (RetrieveParentGroupsResourceGroupResponse)service.Execute(request);

[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.
Dim request As New RetrieveParentGroupsResourceGroupRequest()

' Create the column set.
Dim colSet As New ColumnSet()
colSet.Attributes = New String() { "name", "resourcegroupid" }

' Set up the query.
request.Query = New QueryExpression()
request.Query.ColumnSet = colSet
request.Query.EntityName = EntityName.resourcegroup.ToString()

' ResourceGroupId is the GUID of the resource group.
request.ResourceGroupId = New Guid("2B951FBC-1C56-4430-B23B-20A1349068F3")

' Execute the request.
Dim response As RetrieveParentGroupsResourceGroupResponse = CType(service.Execute(request), RetrieveParentGroupsResourceGroupResponse)

See Also

Concepts

Reference


© 2010 Microsoft Corporation. All rights reserved.


Show:
© 2015 Microsoft