Posts Tagged ‘CRM’

Microsoft CRM Project Creator

November 12, 2010 Leave a comment

Just a quick update on my CRM project on CodePlex. It can create CRM projects for you and setup your NAnt build script automagically 🙂

Still a few loose ends to tie up but should be release in a few days.


Showing Analytics R2 Accelerator in CRM as a Dashboard

November 8, 2010 Leave a comment

This took me a while to get sorted. What you need to do is modify your SiteMap entity and add the following to it.

<SubArea Id="nav_servicedashboard2" Title="New Service Dashboard" Url="http://servername:5555/orgname/crmreports/viewer/viewer.aspx?id={D419505C-9BE8-DF11-A6A1-000C298990C1}&amp;helpID=Service%20Dashboard.rdl&amp;action=filter" Icon="/_imgs/area/18_reports.gif">
              <Title LCID="1033" Title="Dashboards" />
              <Description LCID="1033" Description="Dashboards" />
            <Privilege Entity="report" Privilege="Read" />

Replace the {D419505C-9BE8-DF11-A6A1-000C298990C1} Guid with the Guid of your report.


MS CRM Extensions Project 0.3

October 22, 2010 Leave a comment

Just release a new version of the extensions for CRM on codeplex at for download.

The is new Nant build task goodness 🙂

Next Version will contain a Project creator which I am currently working on. This will give you a default VS 2008 project, A build script, A set of extensions and sample ready to rock and roll for your next project 🙂


Automating MS CRM Deployment With NAnt – Sample Build Script

October 22, 2010 2 comments

Here is a sample build script to deploy plugins, backup and deploy customisations to MS CRM Server.

It uses the MSCRM Extensions Project I developed on CodePlex. You can get it here. Hope you enjoy this.

<?xml version="1.0" ?>
<project name="CRMPlugins" default="compile" xmlns="">
  <property name="compile.mode" value="Debug" unless="${property::exists('compile.mode')}" />
	<property name="build.dir" readonly="true" value="build" />
  <property name="deploy.dir" readonly="true" value="deploy" />
  <property name="source.dir" value="Source" />
  <property name="dist.dir" readonly="true" value="distribution" />
  <property name="customisations.dir" value="Customisations" />
	<property name="nant.settings.currentframework" readonly="true" value="net-3.5" />
  <property name="" value="Test.Plugins"/>
  <property name="compile.dir" readonly="true" value="${source.dir}\${}\${}\bin\${compile.mode}"/>
  <property name="solution.file" value="${source.dir}\${}\${}.sln"/>
  <property name="plugin.solution.file" readonly="true" value="Plugins.xml"/>
  <property name="dist.file" readonly="true" value=""/>

	<target name="compile">
		<msbuild project="${solution.file}">
			<property name="Configuration" value="${compile.mode}" verbose="false" />
	<target name="full" depends="dist" />

  <target name="export-customisations">
    <crmcustexport crmserver="main.test.local" username="Test" password="Test" domain="Test"
                   file="${customisations.dir}\customisations.xml" org="Test" port="5555"/>

  <target name="publish-customisations">
    <crmcustdeploy crmserver="main.test.local" username="Test" password="Test" domain="Test"
                   file="${customisations.dir}\customisations.xml" org="Test" port="5555"/>

  <target name="build" depends="compile,export-customisations">
    <delete dir="${build.dir}" if="${directory::exists(build.dir)}"/>
    <mkdir dir="${build.dir}" unless="${directory::exists(build.dir)}"/>
    <copy todir="${build.dir}">
      <fileset basedir="${compile.dir}">
        <include name="**\*"/>
        <exclude name="**\*.pdb" />
    <copy todir="${build.dir}" file="${customisations.dir}\customisations.xml"/>
	<target name="dist" depends="build">
    <delete dir="${dist.dir}" if="${directory::exists(dist.dir)}"/>
    <mkdir dir="${dist.dir}" unless="${directory::exists(dist.dir)}"/>
		<zip zipfile="${dist.dir}\${dist.file}">
			<fileset basedir="${build.dir}">
				<include name="**\*" />

  <target name="deploy" depends="dist" >
    <delete dir="${deploy.dir}" if="${directory::exists(deploy.dir)}" failonerror="true"/>
    <mkdir dir="${deploy.dir}" unless="${directory::exists(deploy.dir)}"/>
    <unzip todir="${deploy.dir}" failonerror="true" zipfile="${dist.dir}\${dist.file}" />
    <copy todir="${deploy.dir}" file="${plugin.solution.file}" failonerror="true"/>
    <deployplugins crmserver="main.test.local" username="Test" password="Test" domain="Test"
                   pluginfiledirectory="${deploy.dir}" file="${plugin.solution.file}" org="Test" port="5555"/>

Heres the output. Cool hey.

NAnt 0.86 (Build 0.86.2898.0; beta1; 8/12/2007)
Copyright (C) 2001-2007 Gerry Shaw

Buildfile: file:///c:/Projects/Test/MSCRM/
Target framework: Microsoft .NET Framework 3.5
Target(s) specified: deploy


[msbuild] Build started 22/10/2010 12:44:51 PM.
[msbuild] Project “c:\Projects\Test\MSCRM\Source\Test.Plugi
ns\Test.Plugins.sln” on node 0 (default targets).
[msbuild] Building solution configuration “Release|Any CPU”.
[msbuild] Project “c:\Projects\Test\MSCRM\Source\Test.Plugi
ns\Test.Plugins.sln” (1) is building “c:\Projects\Test\MSCRM\
dWellTechnologies.Plugins.csproj” (2) on node 0 (default targets).
[msbuild] Processing 0 EDMX files.
[msbuild] Finished processing 0 EDMX files.
[msbuild] CoreCompile:
[msbuild] Skipping target “CoreCompile” because all output files are up-to-dat
e with respect to the input files.
[msbuild] CopyFilesToOutputDirectory:
[msbuild] Test.Plugins -> c:\Projects\Test\MSCRM\Source\Test.Plugins\Test.Plugins\bin\Release\Test.Plugins.dll
[msbuild] Done Building Project “c:\Projects\Test\MSCRM\Source\Test\Test.Plugins\Test.Plugi
ns.csproj” (default targets).
[msbuild] Done Building Project “c:\Projects\Test\MSCRM\Source\Test.Plugins\Test.Plugins.sln” (default targets).
[msbuild] Build succeeded.
[msbuild] 0 Warning(s)
[msbuild] 0 Error(s)
[msbuild] Time Elapsed 00:00:00.23


Creating Connection
About to export
Export completed
Export data saved


[delete] Deleting directory ‘c:\Projects\Test\MSCRM\build’.
[mkdir] Creating directory ‘c:\Projects\Test\MSCRM\build’.
[copy] Copying 1 file to ‘c:\Projects\Test\MSCRM\build’.
[copy] Copying 1 file to ‘c:\Projects\Test\MSCRM\build’.


[delete] Deleting directory ‘c:\Projects\Test\MSCRM\distribution’.
[mkdir] Creating directory ‘c:\Projects\Test\MSCRM\distribution’.
[zip] Zipping 2 files to ‘c:\Projects\Test\MSCRM\distribution\’.


[delete] Deleting directory ‘c:\Projects\Test\MSCRM\deploy’.
[mkdir] Creating directory ‘c:\Projects\Test\MSCRM\deploy’.
[unzip] Unzipping ‘c:\Projects\Test\MSCRM\distribution\’ to ‘c:\Projects\Test\MSCRM\deploy’.
[copy] Copying 1 file to ‘c:\Projects\Test\MSCRM\deploy’.
Creating Connection
Removing Existing Installation of Plugin
Registering Plugin Solution
Plugin Solution Registered
Registering Individual Plugins
Registering individual plugins completed
Process completed


Total time: 14.9 seconds.

So its pretty easy.

MS CRM Custom NAnt Tasks

October 8, 2010 Leave a comment

I had to automate CRM deployment and so I wrote some custom NAnt tasks to do so which are part of MS CRM Extensions project located at codeplex at for download.

Still needs a lot of testing but It will definitely be in the next release.

Categories: Development Tags: , , , , ,

MS CRM Extension Version 0.2

October 1, 2010 Leave a comment

Just release a new version of the extensions for CRM on codeplex at for download.

There is also some brief documentation on what the extension provides.

Some feature that will be in the next version are support for NServiceBus in Plugins and a Custom Workflow Activity for Messaging.


Microsoft CRM LINQ

September 17, 2010 Leave a comment

If you have been under a rock the latest version of MS CRM SDK contains new bits that allow you to use LINQ plus other goodness over MS CRM.

So how do we set all this Up?

Setup Steps:

  1. Download the latest SDK from MS
  2. Reference the following Assemblies: microsoft.xrm.client.dll, microsoft.xrm.portal.dll, antixsslibrary.dll, microsoft.crm.sdk.dll,microsoft.crm.sdktypeproxy.dll,microsoft.crm.sdktypeproxy.xmlserializers.dll
  3. Create an entry in you web.config / app.config file pointing to your CRM server
  4. <connectionStrings>
          <add name="Crm" connectionString="Authentication Type=AD; Server=http://localhost:5555/Test; User ID=Test\blair; Password=somepassword;"/>

Lets create a query and look at a dynamic version of contacts now 🙂

            var context = new CrmDataContext("Crm");
            var results = from contact in context.GetEntities("contact") select contact;
            return results.ToList().Select(x => x.ToDynamicEntity()).ToList();

So there you go. Review MS Documentation. But I hope this helps you get started.

MS Documentation is here.