AddItemCampaign Message

banner art

Adds an item to a campaign. The item added must be one of the following entity types: campaign, list, product, or salesliterature.

The relevant classes are specified in the following table.

Type Class
Request AddItemCampaignRequest
Response AddItemCampaignResponse
Entity campaign

Remarks

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

Example

The following code example demonstrates how to add an item to a campaign.

[C#]
// Set up the CRM Service.
CrmService service = new CrmService();
service.Credentials = System.Net.CredentialCache.DefaultCredentials;

// Create the Request Object
AddItemCampaignRequest add = new AddItemCampaignRequest();

// Set the Request Object's Properties
add.CampaignId = campaignId;
add.EntityId = productId;
add.EntityName = EntityName.product;

// Execute the Request
AddItemCampaignResponse added = (AddItemCampaignResponse) service.Execute(add); 
[Visual Basic .NET]
' Set up the CRM Service.
Dim service As New CrmService()
service.Credentials = System.Net.CredentialCache.DefaultCredentials

' Create the Request Object
Dim add As New AddItemCampaignRequest()

' Set the Request Object's Properties
add.CampaignId = campaignId
add.EntityId = productId
add.EntityName = EntityName.product

' Execute the Request
Dim added As AddItemCampaignResponse = CType(service.Execute(add), AddItemCampaignResponse)

Related Topics

CrmService Messages


© 2007 Microsoft Corporation. All rights reserved.


Show: