Export (0) Print
Expand All
Expand Minimize

RetrieveMembersBulkOperation Message (CrmService)

banner art

[Applies to: Microsoft Dynamics CRM 4.0]

Works for all deployment typesWorks online and offline

Retrieves the members of a bulk operation.

The relevant classes are specified in the following table.

TypeClass
RequestRetrieveMembersBulkOperation
ResponseRetrieveMembersBulkOperation
Entitybulkoperation

Remarks

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

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

Example

The following code example shows how to use the RetrieveMembersBulkOperation 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 a phone activity to be distributed (bulk operation).
phonecall samplePhoneCall = new phonecall();
samplePhoneCall.subject = "Sample phone call to distribute to a marketing list.";

// The owner property is a REQUIRED property.
WhoAmIRequest systemUserRequest = new WhoAmIRequest();
WhoAmIResponse systemUser = (WhoAmIResponse)service.Execute(systemUserRequest);

// Execute a bulk operation.
DistributeCampaignActivityRequest distributeCampaignRequest = new DistributeCampaignActivityRequest();
distributeCampaignRequest.Activity = samplePhoneCall;
distributeCampaignRequest.CampaignActivityId = new Guid("80513ACC-C405-DD11-9792-0003FFBAD2C7");
distributeCampaignRequest.Propagate = true;
distributeCampaignRequest.SendEmail = false;
distributeCampaignRequest.Owner = new Moniker();
distributeCampaignRequest.Owner.Id = new Guid("7b80513ACC-C405-DD11-9792-0003FFBAD2C7");
distributeCampaignRequest.Owner.Name = EntityName.systemuser.ToString();

DistributeCampaignActivityResponse distributeCampaignResponse = (DistributeCampaignActivityResponse)service.Execute(distributeCampaignRequest);

// Execute the request.
RetrieveMembersBulkOperationRequest getMembers = new RetrieveMembersBulkOperationRequest();
getMembers.BulkOperationId = distributeCampaignResponse.BulkOperationId;
getMembers.BulkOperationSource = BulkOperationSource.CampaignActivity;
getMembers.EntitySource = EntitySource.Account;
getMembers.ReturnDynamicEntities = false;

RetrieveMembersBulkOperationResponse membersResponse = (RetrieveMembersBulkOperationResponse)service.Execute(getMembers);
[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 a phone activity to be distributed (bulk operation).
Dim samplePhoneCall As New phonecall()
samplePhoneCall.subject = "Sample phone call to distribute to a marketing list."

' The owner property is a REQUIRED property.
Dim systemUserRequest As New WhoAmIRequest()
Dim systemUser As WhoAmIResponse = CType(service.Execute(systemUserRequest), WhoAmIResponse)

' Execute a bulk operation.
Dim distributeCampaignRequest As New DistributeCampaignActivityRequest()
distributeCampaignRequest.Activity = samplePhoneCall
distributeCampaignRequest.CampaignActivityId = New Guid("80513ACC-C405-DD11-9792-0003FFBAD2C7")
distributeCampaignRequest.Propagate = True
distributeCampaignRequest.SendEmail = False
distributeCampaignRequest.Owner = New Moniker()
distributeCampaignRequest.Owner.Id = New Guid("7b80513ACC-C405-DD11-9792-0003FFBAD2C7")
distributeCampaignRequest.Owner.Name = EntityName.systemuser.ToString()

Dim distributeCampaignResponse As DistributeCampaignActivityResponse = CType(service.Execute(distributeCampaignRequest), DistributeCampaignActivityResponse)

' Execute the request.
Dim getMembers As New RetrieveMembersBulkOperationRequest()
getMembers.BulkOperationId = distributeCampaignResponse.BulkOperationId
getMembers.BulkOperationSource = BulkOperationSource.CampaignActivity
getMembers.EntitySource = EntitySource.Account
getMembers.ReturnDynamicEntities = False

Dim membersResponse As RetrieveMembersBulkOperationResponse = CType(service.Execute(getMembers), RetrieveMembersBulkOperationResponse)

See Also

Concepts

Reference


© 2010 Microsoft Corporation. All rights reserved.


Show:
© 2014 Microsoft