Archive

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.

Advertisements

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">
            <Titles>
              <Title LCID="1033" Title="Dashboards" />
            </Titles>
            <Descriptions>
              <Description LCID="1033" Description="Dashboards" />
            </Descriptions>
            <Privilege Entity="report" Privilege="Read" />
          </SubArea>

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

Blair

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 http://mscrmextensions.codeplex.com 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 🙂

Blair

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="http://nant.sf.net/schemas/nant.xsd">
  <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="plugins.name" value="Test.Plugins"/>
  <property name="compile.dir" readonly="true" value="${source.dir}\${plugins.name}\${plugins.name}\bin\${compile.mode}"/>
  <property name="solution.file" value="${source.dir}\${plugins.name}\${plugins.name}.sln"/>
  <property name="plugin.solution.file" readonly="true" value="Plugins.xml"/>
  <property name="dist.file" readonly="true" value="Test.zip"/>

	<target name="compile">
		<msbuild project="${solution.file}">
			<property name="Configuration" value="${compile.mode}" verbose="false" />
		</msbuild>
	</target>
		
	<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>

  <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>

  <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" />
      </fileset>
    </copy>
    <copy todir="${build.dir}" file="${customisations.dir}\customisations.xml"/>
  </target>
	
	<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="**\*" />
			</fileset>
		</zip>
	</target>

  <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"/>
  </target>
	
</project>

Heres the output. Cool hey.

NAnt 0.86 (Build 0.86.2898.0; beta1; 8/12/2007)
Copyright (C) 2001-2007 Gerry Shaw
http://nant.sourceforge.net

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

compile:

[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\
Source\Test.Plugins\Test.Plugins\Advance
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]
[msbuild] Build succeeded.
[msbuild] 0 Warning(s)
[msbuild] 0 Error(s)
[msbuild]
[msbuild] Time Elapsed 00:00:00.23

export-customisations:

Creating Connection
About to export
Export completed
Export data saved

build:

[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’.

dist:

[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\Test.zip’.

deploy:

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

BUILD SUCCEEDED

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 http://mscrmextensions.codeplex.com 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 http://mscrmextensions.codeplex.com 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.

Blair

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;"/>
      </connectionStrings>
    

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.

Blair..