serving the solutions day and night

Pages

Wednesday, April 17, 2013

CRM 2011/2013 Development Toolkit

http://msdn.microsoft.com/en-us/library/hh372957%28v=crm.6%29.aspx

With the Developer Toolkit, you can do the following:
  • Easily generate strongly typed proxy classes without having to run CrmSvcUtil.exe.
  • Generate plug-in code so you can immediately begin to write code for business logic.
  • Edit and register plug-ins without using the Plug-in registration tool.
  • Create new web resources or extract existing web resources, add them to your solution, edit them, and deploy changes all within Visual Studio.
  • Create and edit workflow and dialog processes from within Visual Studio.
  • Get easy access to entity and option set definitions, security role and field security profile information in Visual Studio.
Download SDK http://www.microsoft.com/en-us/download/details.aspx?id=40321


Create a new project, choose New Visual Studio Solution Template, it will allow to create plugins, workflows, web resources, silverlight application & workflows.


When the project is created it will pop up the Connect to CRM server dialog.

Press cancel to create new silverlight application if you are not using.
See the list of created packages in solution explorer.

View -> CRM Explorer - displays information about solution components available in the organization. http://msdn.microsoft.com/en-us/library/hh547388%28v=crm.6%29.aspx


RegisterFile.crmregister - is a file which holds the plugin registration data any plugins created in your CrmPackage.  The details are then used to deploy plugins to CRM.
Plugin.cs -  is a default file created by the CRM 2013 Development Toolkit.  When you create a plugin, it will extend the Plugin class and use it as a base.   The Plugin class uses the IPlugin interface and has the Execute methods.
Open the CRM Explorer, select entity, right click and choose create Plug-in, Create Plug-in screen will be displayed [Reference Dynamics CRM Plugin Registration Tool]. After you done, a new file will be created in the plugin project, for example FullName.cs

namespace DNS.PeopleManagement.Plugins
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    using DNS.Crm.Entities;
    using EDMBL = DNS.Crm.BusinessLogic;
    using Microsoft.Xrm.Sdk;
    using Microsoft.Xrm.Sdk.Query;
    using Microsoft.Crm.Sdk.Messages;
    using System.Globalization;
  
    public class FullName : Plugin
    {
        public FullName()
            : base(typeof(FullName))
        {
            base.RegisteredEvents.Add(new Tuple<int, string, string, Action<LocalPluginContext>>(20, "Create", Contact.EntityLogicalName, new Action<LocalPluginContext>(ExecuteCreate)));
            base.RegisteredEvents.Add(new Tuple<int, string, string, Action<LocalPluginContext>>(20, "Update", Contact.EntityLogicalName, new Action<LocalPluginContext>(ExecuteUpdate)));

        }
        protected void ExecuteCreate(LocalPluginContext localContext)
        {
           
        }

        protected void ExecuteUpdate(LocalPluginContext localContext)
        {
          
        }
      
    }
}

The Development Toolkit will also update the RegisterFile.crmregister adding a new line for the account plugin you have added. Default GUID values are 0000, once it has beeen deployed, GUID will be real GUID value. Deploy through CrmPackgae. You can verify all the deployed Plugin from CRM Explorere Plug-in Assemblies

WebResources - is a folder to add/modify resources to the CRM solution.

Deploy your solution to the server by right-clicking CrmPackage and then clicking Deploy.


Error - "No Organization has been specified", "The Caller wat not authenticated by the service."

When you try to open a project that was created using Developer toolkit,  you will get the above error. The reason is your active directory password may be changed.

Resolve,
1) Tools –> Connect to Dynamics CRM Server - Connect CRM organization and correct CRM solution, re enter new password.
2)Delete *.SUO(VS Solution User Option) file from Visual Studio Project folder. It's user settings files, you will lose the project breakpoints.


Missing CRM Explorer in Visual Studio 2012
Opening a CRM project in Visual Studio 2012, VS doesn't contain option to 'Connect To Dynamics CRM Server' in the TOOLS menu.
TO fix it
1.Close VS  & 2. Open the VS Solution file in a text editor.
2. Find the Global section and insert the highlighted section below at the beginning of the section
Global
    GlobalSection(CRMSolutionProperties) = preSolution
        SolutionIsBoundToCRM = True
    EndGlobalSection
    GlobalSection(SolutionConfigurationPlatforms) = preSolution
        Debug|Any CPU = Debug|Any CPU
        Debug|Mixed Platforms = Debug|Mixed Platforms
        Debug|x86 = Debug|x86
        Release|Any CPU = Release|Any CPU
        Release|Mixed Platforms = Release|Mixed Platforms
        Release|x86 = Release|x86
    EndGlobalSection
EndGlobal
3.Save the file.
4.Open the Visual Studio project, enter the CRM settings.

1 comment:

kamal mehta said...

Nice blog ,Thanks for sharing this information with link .




Dynamics CRM Developers