RetrieveParentGroupsResourceGroup Message

banner art

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

The relevant classes are specified in the following table.

Type Class
Request RetrieveParentGroupsResourceGroupRequest
Response RetrieveParentGroupsResourceGroupResponse
Entity resourcegroup

Remarks

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.
CrmService service = new CrmService();
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 service As New CrmService()
service.Credentials = System.Net.CredentialCache.DefaultCredentials

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

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

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

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

Related Topics

CrmService Messages

© 2007 Microsoft Corporation. All rights reserved.