serving the solutions day and night

Pages

Showing posts with label bulk delete request. Show all posts
Showing posts with label bulk delete request. Show all posts

Wednesday, September 4, 2013

MS Dynamics CRM - Bulk Delete using XRM

Import
MSDynamicsCRM2011.DNS.Entities
microsoft.crm.sdk.proxy
microsoft.xrm.client
microsoft.xrm.sdk
System.ServiceModel
System.Data.DataSetExtensions

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Crm.Sdk.Messages;
using Microsoft.Xrm.Sdk;
using Microsoft.Xrm.Sdk.Client;
using Microsoft.Xrm.Sdk.Query;
using GCEntity = BT.CRM2011.DNS.Entities;
using System.ServiceModel.Description;

namespace CRM.Audit.BulkDelete
{
    class Audit
    {
        private BulkDeleteResponse _bdRes;
        private Guid _bdResID;
        private Guid _bdGUID;
        private ConditionExpression _conExp;

//Delete Method
        public void Delete()
        {
            SystemJob(GCEntity.dns_audit.EntityLogicalName, "Audit Bulk Delete - Code", _conExp);
            Console.WriteLine("Audit Deleted");
            SystemJob(GCEntity.Contact.EntityLogicalName, "Contact Bulk Delete - Code", _conExp);
            Console.WriteLine("Contact Deleted");
            Console.ReadLine();
        }