Pages

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

Tuesday, September 10, 2013

Programming Models for MS Dynamics CRM 2011


Key programmability scenarios for MS Dynamics CRM 2011



Early-bound – MS Dynamics CRM 2011 uses an entity data model and Windows Communication Foundation (WCF) Data Services technologies to provide a new set of tools that interact with Microsoft Dynamics CRM. For example: an organization service context that tracks changes to objects and supports .NET Language-Integrated Query (LINQ) queries to retrieve data from MS Dynamics CRM. Early bound classes generated directly from the metadata, which include all customizations.
CrmSvcUtil.exe - CRM Dynamics 2011 Code Generation Tool

Improve PrincipalObjectAccess (POA) and AsyncoperationBase table performance in MS Dynamics CRM 2011

PrincipalObjectAccess (POA) table

Grant permission for a user to see/edit/delete a record in CRM.

Permissions are granted is through either Direct or Inherited shares. 

Direct Shares are the user shares a record to another user or team through the 'share' button in the ribbon. These records will have a value in the AccessRightsMask colum of the POA table.

Inherited Shares are the result of a number of different configuration rules – such as the shares that cascade to an object based on the ownership of its parent record, Custom code that shares a record, or by the system due to relationship behaviors or system settings. These records will have a value in the InheritedAccessRightsMask colum of the POA table.

The shares granted on objects in CRM are stored in the PrincipalObjectAccess (POA) system table. Since almost every access to CRM data interacts with the POA table.

Friday, September 6, 2013

MS Dynamics CRM 2011 - Display Lists/Views Dynamically

Audit_matchlist.htm - HTML Page Code

This page will build fetchxml, display event list from event entity, matchtype option set, and bind the result in the frame.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta content="text/html;charset=utf-8" http-equiv="Content-Type"/>
    <meta content="utf-8" http-equiv="encoding"/>
    <meta http-equiv="X-UA-Compatible" content="IE=EDGE" />
    <meta http-equiv="CACHE-CONTROL" content="NO-CACHE"/>
    <link href="/WebResources/dns_CSS/audit.css" rel="Stylesheet" />

    <script src="../ClientGlobalContext.js.aspx" type="text/javascript"></script>
    <script src="/WebResources/dns_JavaScript/Jquery1.4.1.min.js" type="text/javascript" language="javascript"></script>
    <script src="/WebResources/dns_JavaScript/Jason.js" type="text/javascript" language="javascript"></script>
    <script src="/WebResources/dns_JavaScript/advancedfindview.js" type="text/javascript" language="javascript"></script>
    <script src="/WebResources/dns_JavaScript/DataOperations.js" type="text/javascript" language="javascript"></script>
    <script src="/WebResources/dns_JavaScript/audit.js" type="text/javascript" language="javascript"></script>
    <script type="text/javascript">
        var ECMRole = CheckUserRole("ECM");
       
        //alert(window.location.href);

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();
        }

Tuesday, September 3, 2013

MS Dynamics CRM 2011 - Ribbon Drop Down Menu

This blog will guide you, how to create drop down menu from the ribbon. It contains one group or button ('Audit') ,2 drop down menu and their commands/actions.



 1) Create a solution contains Application Ribbons and Site Map.