Пример #1
0
        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 a <c>Campaign Activity</c>.
        /// <para>
        /// For more information look at https://msdn.microsoft.com/en-us/library/microsoft.crm.sdk.messages.removeitemcampaignactivityrequest(v=crm.8).aspx
        /// </para>
        /// </summary>
        /// <param name="campaignActivityId"><c>CampaignActivity</c> Id</param>
        /// <param name="itemId">Item Id</param>
        /// <returns><see cref="RemoveItemCampaignActivityResponse"/></returns>
        public RemoveItemCampaignActivityResponse RemoveItem(Guid campaignActivityId, Guid itemId)
        {
            ExceptionThrow.IfGuidEmpty(campaignActivityId, "campaignActivityId");
            ExceptionThrow.IfGuidEmpty(itemId, "itemId");

            RemoveItemCampaignActivityRequest request = new RemoveItemCampaignActivityRequest()
            {
                CampaignActivityId = campaignActivityId,
                ItemId             = itemId
            };

            return((RemoveItemCampaignActivityResponse)this.OrganizationService.Execute(request));
        }
Пример #3
0
        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.");
        }
        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>
        }