private void RemoveRelationships() { //<snippetDistributeCampaignFromMarketingList10> // Remove the marketing list from the campaign activity. var removeFromCampaignActivity = new RemoveItemCampaignActivityRequest { CampaignActivityId = _campaignActivityId, ItemId = _copiedMarketingListId }; _serviceProxy.Execute(removeFromCampaignActivity); Console.WriteLine(" Removed the marketing list from the campaign activity."); //</snippetDistributeCampaignFromMarketingList10> //<snippetDistributeCampaignFromMarketingList11> // Remove the marketing list from the campaign. var removeFromCampaign = new RemoveItemCampaignRequest { CampaignId = _campaignId, EntityId = _copiedMarketingListId }; _serviceProxy.Execute(removeFromCampaign); Console.WriteLine(" Removed the marketing list from the campaign."); //</snippetDistributeCampaignFromMarketingList11> }
/// <summary> /// Remove an item from <c>Campaign</c>. /// <para> /// For more information look at https://msdn.microsoft.com/en-us/library/microsoft.crm.sdk.messages.removeitemcampaignrequest(v=crm.8).aspx /// </para> /// </summary> /// <param name="campaignId"><c>Campaign</c> Id</param> /// <param name="itemId">Item Id</param> /// <returns> /// <see cref="RemoveItemCampaignResponse"/> /// </returns> public RemoveItemCampaignResponse RemoveItem(Guid campaignId, Guid itemId) { ExceptionThrow.IfGuidEmpty(campaignId, "campaignId"); ExceptionThrow.IfGuidEmpty(itemId, "itemId"); RemoveItemCampaignRequest request = new RemoveItemCampaignRequest() { CampaignId = campaignId, EntityId = itemId }; return((RemoveItemCampaignResponse)this.OrganizationService.Execute(request)); }
private static void RemoveRelationships(CrmServiceClient service) { // Remove the marketing list from the campaign activity. var removeFromCampaignActivity = new RemoveItemCampaignActivityRequest { CampaignActivityId = _campaignActivityId, ItemId = _copiedMarketingListId }; service.Execute(removeFromCampaignActivity); Console.WriteLine(" Removed the marketing list from the campaign activity."); // Remove the marketing list from the campaign. var removeFromCampaign = new RemoveItemCampaignRequest { CampaignId = _campaignId, EntityId = _copiedMarketingListId }; service.Execute(removeFromCampaign); Console.WriteLine(" Removed the marketing list from the campaign."); }