serving the solutions day and night

Pages

Showing posts with label entity. Show all posts
Showing posts with label entity. Show all posts

Tuesday, April 15, 2014

Migrating selected entities data from UAT MS Dynamics 2011 to PROD MS Dynamics CRM 2011

Migrating selected entities data from UAT MS Dynamics 2011 to PROD MS Dynamics CRM 2011

Recently i engaged a new project to migrating data from one CRM server to another CRM server for selected entities.
Challenging work is moving email related entity data to another CRM server.
Here i going to discuss only email related entity code work.

I did this work using both CRM service and direct sql update.

1) i created 2 service, let assume one is UAT and another is PROD
public static OrganizationServiceProxy U_CRMServiceProxy
{
    get
    {
    var uri = new Uri(U_URI);

    //Authenticate using credentials of the logged in user;      
    var cntCredentials = new ClientCredentials();
    cntCredentials.Windows.ClientCredential.Domain = Domain;
    cntCredentials.Windows.ClientCredential.UserName = U_User;
    cntCredentials.Windows.ClientCredential.Password = U_Pass;
    //cntCredentials.Windows.ClientCredential = CredentialCache.DefaultNetworkCredentials;

    var serviceProxy = new OrganizationServiceProxy(uri, null, cntCredentials, null);
    //serviceProxy.ServiceConfiguration.CurrentServiceEndpoint.Behaviors.Add(new ProxyTypesBehavior());
    serviceProxy.EnableProxyTypes();

    return serviceProxy;
    }
}


Wednesday, September 11, 2013

MS Dynamics CRM Web Services 2011

MS Dynamics CRM 2011 provides two Web services. These services can be used to identify your organization and to access MS Dynamics CRM data.

IDiscoveryService Web Service - A single MS Dynamics CRM installation can host multiple organizations on multiple servers. The IDiscoveryService Web service returns a list of organizations that the specified user belongs to and the URL endpoint address for each organization.
http[s]://< hostname[:port]>/XRMServices/2011/Discovery.svc

To access the IDiscoveryService Web service, use Microsoft.Xrm.Sdk.dll assembly -> Microsoft.Xrm.Sdk.Discovery namespace.
Use the Execute method to execute a discovery service message.
RetrieveOrganizationRequest - Retrieves information about a single organization.
RetrieveOrganizationsRequest - Retrieves information about all organizations to which the user belongs.
RetrieveOrganizationsResponse

IOrganizationService Web Service - The Web service for accessing data and metadata in MS Dynamics CRM 2011
Organization Service Methods - Create, Retrieve, RetrieveMultiple, Update, Delete, Associate ( create a link between two records), Disassociate, Execute

IOrganizationService Entities

Best Practices for Developing with Microsoft Dynamics CRM

Wednesday, April 17, 2013

CRM Plugin Code - Add/Update Entity, Connect WebService, Update Database

//Update Same Entity, Other entity, create new record in other entity  and connect to WebService
//Update to database  and
//Webservice update to database

using System;
using System.Diagnostics;
using System.Linq;
using Microsoft.Xrm.Sdk;

using Microsoft.Xrm.Sdk.Query;
using System.Xml;
using System.Net;
using GCEntity = CRMEnt.Entities;
using System.Text;
using System.ServiceModel;

Thursday, February 21, 2013

CRM Metadata

Metadata is defined as data about data. MS Dynamics CRM uses a metadata driven architecture to provide the flexibility to create custom entities and additional system entity attributes.
MS Dynamics CRM retrieves the record data from the metadata (entities, attributes, relationships, and option sets.), which in turn retrieves information from the underlying system data. MS Dynamics CRM stores its underlying system data in a relational database using Microsoft SQL Server.

MS Dynamics User Interface  ->  Metadata ->  Underlying System Data (SQL Server)

The entity metadata controls the grid and form layout, and how navigation options are presented. The metadata makes heavy use of MS Dynamics CRM Web services and XML data formats.

Make changes directly to CRM database in Microsoft SQL Server, risk of damaging the metadata and creating errors in your system.

Tuesday, February 12, 2013

Get CRM PickList & Global OptionSet using c#

using System.ServiceModel.Description;
using Microsoft.Xrm.Sdk;
using Microsoft.Xrm.Sdk.Client;
using Microsoft.Xrm.Sdk.Query;
using Microsoft.Xrm.Sdk.Messages;
using Microsoft.Xrm.Sdk.Metadata;

Uri OrganizationUri = new Uri(System.Configuration.ConfigurationManager.AppSettings["CRM_Organization_URI"].ToString());
Uri HomeRealmUri = null;
Dictionary<String, String> dicState = new Dictionary<String, String>();
Dictionary<String, String> dicSuffix = new Dictionary<String, String>();

Tuesday, November 27, 2012

CRM Dynamics 2011 - Dynamic Entity using Service Data Context

Refer the blog, how to create CRM Entites and Service Data Context http://makdns.blogspot.com/2012/11/crmsvcutilexe-crm-dynamics-2011-code.html

Add the CRM.Entities.cs file to your project.

Insert, Update, Delete, View and Select Entities list using c#.

Monday, November 26, 2012

CRM Dynamics 2011 - Dynamic Entity

Using C# and IOrganizationService Web Service - A Simple Application will display, add, modify and delete Entity records.

Form design

<div>
        <strong>Contact Form - <asp:Button ID="Insert" runat="server" OnClick="Insert_Click" Text="Insert" /><br /></strong>
        <asp:Literal ID="litViewAll" runat="server"></asp:Literal><br />
        <asp:Panel runat="server" ID="panDetails" Visible="false">
        First Name<asp:TextBox ID="txtFirstName" runat="server"></asp:TextBox><br />
        Last Name<asp:TextBox ID="txtLastName" runat="server"></asp:TextBox><br />
        Address<asp:TextBox ID="txtAddress" runat="server"></asp:TextBox><br />
        City<asp:TextBox ID="txtCity" runat="server"></asp:TextBox><br />
        Zip<asp:TextBox ID="txtZip" runat="server"></asp:TextBox><br />
        State<asp:DropDownList ID="ddlSList" runat="server" AppendDataBoundItems="true">
            <asp:ListItem Selected="True" Text="Select SList" Value="00000000-0000-0000-0000-000000000000"/>
        </asp:DropDownList><br />
        Municipality Name<asp:DropDownList ID="ddlJList" runat="server" AppendDataBoundItems="true">
            <asp:ListItem Selected="True" Text="Select MList" Value="00000000-0000-0000-0000-000000000000"/>
        </asp:DropDownList><br/>      
        <asp:Button ID="CreateNew" runat="server" OnClick="CreateNew_Click" Text="Create" />
        <asp:Button ID="Delete" runat="server" OnClick="Delete_Click" Text="Delete" />
        <asp:Button ID="Update" runat="server" OnClick="Update_Click" Text="Update" /><br />
        </asp:Panel>
        </div>

Wednesday, November 21, 2012

IncludeExceptionDetailInFaults - Display Hidden Error

Create a simple web application to add contact data into the CRM system using c# and IOrganizationService Web Service.

1)Create Empty web application

2)Add References
microsoft.xrm.sdk.dll
microsoft.crm.sdk.proxy.dll
System.Runtime.Serialization
System.ServieModel