Export (0) Print
Expand All
Expand Minimize

RemoveMembersTeam Message (CrmService)

banner art

[Applies to: Microsoft Dynamics CRM 4.0]

Works for all deployment typesWorks online only

Removes members from a team.

The relevant classes are specified in the following table.

TypeClass
RequestRemoveMembersTeamRequest
ResponseRemoveMembersTeamResponse
Entityteam

Remarks

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

To perform this action, the caller must have access rights on the entity instance specified in the request class. For a list of required privileges, see RemoveMembersTeam Privileges.

Example

The following code example shows how to use the RemoveMembersTeam 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.
RemoveMembersTeamRequest remove = new RemoveMembersTeamRequest();

// Set the ID of the team.
remove.TeamId = new Guid("18ECA720-493E-4800-BBFD-638BD54EB325");

// Set the IDs of the members to remove.
remove.MemberIds = new Guid[] { new Guid("2B951FBC-1C56-4430-B23B-20A1349068F3"), new Guid("3A951GCD-2D56-4431-B23B-21B1349068G4") };

// Execute the request.
RemoveMembersTeamResponse removed = (RemoveMembersTeamResponse)service.Execute(remove);
[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 remove As New RemoveMembersTeamRequest()

' Set the ID of the team.
remove.TeamId = New Guid("18ECA720-493E-4800-BBFD-638BD54EB325")

' Set the IDs of the members to remove.
remove.MemberIds = New Guid[] { New Guid("2B951FBC-1C56-4430-B23B-20A1349068F3"), New Guid("3A951GCD-2D56-4431-B23B-21B1349068G4") }

' Execute the request.
Dim removed As RemoveMembersTeamResponse = CType(service.Execute(remove), RemoveMembersTeamResponse)

See Also

Concepts

Reference


© 2010 Microsoft Corporation. All rights reserved.


Show:
© 2014 Microsoft