Posts

Showing posts from July, 2015

How to retreive CRM records from an Entity using Fetch XML in Dynamics CRM and show on Grid view using c#. How to Bulk delete records from CRM using c#

Image
In this blog I am going to explain how we could retrive/ delete all records from an entity in CRM using C#. For this demo I have taken a windows application, check the below steps and use the code as it is. This code also includes code how we could show Entity data in Gridview.



1. First of all take two different buttons. First button for retreiving records and 2nd button is for deleting records from an entity in CRM.

2. Place a Gridview control too in your form.

3. Now place code as below on Browse, Bulk_Upload button::

        OrganizationService _orgservice = new OrganizationService(CrmConnection.Parse("Url=https://yourSolution.crm5.dynamics.com; Username=admin@yourSolution.onmicrosoft.com; Password=pass@word1;"));

            //Retrive All records from an Entity in CRM using ExecuteMultipleRequest
        private void btnRtvMultiple_Click(object sender, EventArgs e)
        {
            DataTable dt = new DataTable();
            EntityCollection ecContacts = getAllCont…

Bulk upload data in Microsoft Dynamics CRM from Excel using c#, How to Import data from Excel in C#

Image
In this blog I am going to explain how we could upload bulk data in CRM from Excel sheet using C#. For this demo I have taken a windows application, check the below steps and use the code as it is. This code also includes code how we could import Excel data.


1. First of all take a textbox and two different buttons. textbox for showing teh selected file path and first button for Browsing file and 2nd button is for uploading Data in CRM.

2. Place a OpenFileDialog control too in your form.



3. Now place code as below on Browse, Bulk_Upload button::


OrganizationServiceProxy _orgservice = CreateCrmServiceObject();

        private void btnBrowse_Click(object sender, EventArgs e)
        {
            DialogResult fd = openFileDialog1.ShowDialog();
            if (fd == DialogResult.OK)
            {
                textBox1.Text = openFileDialog1.FileName;
            }
        }

        //Browse excel file for bulk uploading in CRM
        private void btnUpload_Click(object sender, EventA…
go to top image