This documentation is archived and is not being maintained.

DistributeCampaignActivity 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

Creates a bulk operation to distribute the activity, creating the appropriate activity for each member in the list for the specified campaign activity.

The relevant classes are specified in the following table.



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

To perform this action the caller must have access rights on the entity instances retrieved. For a list of required privileges, see DistributeCampaignActivity Privileges.


// 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;

Moniker ownerMoniker = new Moniker();
ownerMoniker.Id = new Guid("326A0053-71CB-465E-9BEB-633E2E0851A9");
ownerMoniker.Name = EntityName.systemuser.ToString();

// Create the request object.
DistributeCampaignActivityRequest request = new DistributeCampaignActivityRequest();

// Set the properties of the request object.
request.Activity = new phonecall();
request.CampaignActivityId = new Guid("326A0053-71CB-465E-9BEB-633E2E0851A9");
request.OwnershipOptions = PropagationOwnershipOptions.ListMemberOwner;
request.Owner = ownerMoniker;

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

See Also



© 2010 Microsoft Corporation. All rights reserved.