Export (0) Print
Expand All
Expand Minimize

RemoveItemCampaignActivity Message (CrmService)

banner art

[Applies to: Microsoft Dynamics CRM 4.0]

Works for all deployment typesWorks online and offline

Removes an item from a campaign activity.

The relevant classes are specified in the following table.

TypeClass
RequestRemoveItemCampaignActivityRequest
ResponseRemoveItemCampaignActivityResponse
Entitycampaignactivity

Remarks

To use this message, pass an instance of the RemoveItemCampaignActivityRequest 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 RemoveItemCampaignActivity Privileges.

Example

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

// Set the ID of the campaign activity.
remove.CampaignActivityId = new Guid("2B951FBC-1C56-4430-B23B-20A1349068F3");

// Set the ID of the campaign activity item.
remove.ItemId = new Guid("2B951FBC-1C56-4430-B23B-20A1349068F3");

// Execute the request.
RemoveItemCampaignActivityResponse removed = 
    (RemoveItemCampaignActivityResponse)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 RemoveItemCampaignActivityRequest()

' Set the ID of the campaign activity.
remove.CampaignActivityId = New Guid("2B951FBC-1C56-4430-B23B-20A1349068F3")

' Set the ID of the campaign activity item.
remove.ItemId = New Guid("2B951FBC-1C56-4430-B23B-20A1349068F3")

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

See Also

Concepts

Reference


© 2010 Microsoft Corporation. All rights reserved.


Show:
© 2014 Microsoft