ExecuteCampaignActivity Message (CrmService)

banner art

[Applies to: Microsoft Dynamics CRM 4.0]

Find the latest SDK documentation: CRM 2015 SDK

Works for all deployment types Works online only

Executes a campaign activity.

The relevant classes are specified in the following table.

Type Class
Request ExecuteCampaignActivityRequest
Response ExecuteCampaignActivityResponse
Entity campaignactivity

Remarks

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

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

Example

[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.
ExecuteCampaignActivityRequest exec = new ExecuteCampaignActivityRequest();

// Set the properties of the request object.
exec.Activity = new phonecall();
exec.CampaignActivityId = new Guid("07D5B0B3-136C-48C6-8EAC-0030B9466E78");
exec.OwnershipOptions = PropagationOwnershipOptions.ListMemberOwner;
exec.Propagate = true;

// Execute the request.
ExecuteCampaignActivityResponse execed = (ExecuteCampaignActivityResponse) service.Execute(exec);

[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 exec As New ExecuteCampaignActivityRequest()

' Set the properties of the request object.
exec.Activity = New phonecall()
exec.CampaignActivityId = campaignActivityId
exec.OwnershipOptions = PropagationOwnershipOptions.ListMemberOwner
exec.Propagate = True

' Execute the request.
Dim execed As ExecuteCampaignActivityResponse = CType(service.Execute(exec), ExecuteCampaignActivityResponse)

See Also

Concepts

Reference

© 2010 Microsoft Corporation. All rights reserved.