Wednesday, September 29, 2010

Developing for CRM 2011 and SharePoint 2010 Foundation

If you are a MS CRM person looking at SharePoint as something new here are a few things that may be of interest.

The SharePoint 2010 Foundation is free and will work with the MS CRM list component but it is limited to database sizes of 4Gb. This makes it much easier to leverage some of the power of SharePoint for your CRM customers. Your customers by default already have licensing for Windows Server and SQL Server in order to run MS CRM and SharePoint Foundation can share that same server.

In addition the new Business Connectivity Services (BCS) are also supported by SharePoint Foundation: http://msdn.microsoft.com/en-us/library/ee557646.aspx

BCS will allow you to expose data from other databases to show up in SharePoint, but not take space in the SharePoint database, this of course includes CRM data. There is obviously a performance penalty depending on the interface to access this external data, but it also allows maintaining legacy databases while having access to that data in SharePoint without passing the 4Gb database limit in the SharePoint database.

If you are looking at SharePoint integration using their web services, you can see from the following link which services are supported by both SharePoint Foundation and by SharePoint Server and just by SharePoint Server. http://msdn.microsoft.com/en-us/library/ee705814.aspx

As an obvious guideline it would make sense to write your base code to support SharePoint Foundation to let customers try out SharePoint functionality, and to have any features that require SharePoint Server features be switchable at a later time if your customer upgrades.

SharePoint Server has a number of useful features shown in this version comparison that you may or may not need: http://sharepoint.microsoft.com/en-us/buy/Pages/Editions-Comparison.aspx

As a practical note, SP 2010 is built on .NET 3.5 and CRM 2011 is built on .NET 4.0, so while most of you will not have a lot of .NET 4.0 legacy code at this point, is will be important to make sure your libraries with logic that will be shared between SP and CRM components are all kept at .NET 3.5.

Sunday, September 26, 2010

Connecting to MS CRM 2011 outside the VM

While the CRM 2011 VM created so far works well by itself, you will most likely want to access MS CRM web site, web services and endpoints from outside the VM for development purposes.

To do this you will need to set up VirtualBox to allow access from your host computer.

1. With your VM shutdown, modify the Network Settings and enable the second Adapter. As shown below:

  • Attached to: Host-Only Adapter
  • Name: VirtualBox Host-Only Ethernet  Adapter

image

Note: when a VM is created from scratch it appears to select the correct network adapter type. When I copied the VDI file to my laptop and setup a VM based on that VDI file, it picked a different adapter by default and the networking didn’t work until I made it match the original Network settings that I had when I first configured it.
image 

2. Start up your VM, open up a command prompt and run  ipconfig. Notice the new Local Area Connection 2 should be in your local network. The other is the default NAT adapter that allows your VM to see the Internet as your host computer.

image

3. On your host computer go to C:\Windows\System32\drivers\etc and edit your hosts file and add the new IP address to your hosts file.

image

4.You may want to add a new Credential to your Credential Manager to reduce your login time under Control Panel since you are not in the domain of the VM.

Use the Hosts alias created above, then add a domain\username, and password. This will give you a mostly filled out login when you try to reach the website for the first time.

image

5.  Test the connection out by bringing up MS CRM on your host. I’m using the alias in my hosts file pull up CRM.  http://w2008r2crmdev:5555/CRMDEMO

image

6. Now make sure you can access the endpoints through the browser

http://w2008r2crmdev:5555/CRMDEMO/xrmservices/2011/organizationdata.svc/$metadata 
http://w2008r2crmdev:5555/CRMDEMO/xrmservices/2011/organizationdata.svc/

image

7. If the endpoints show up in the browser than they should be available to add a reference to a Silverlight project as shown below.

VS Service Reference MetaData

Side Note: I have found that this VM is capable of running with 2.3Gb of RAM and on one core on my 2 year old Core Duo laptop. There is just enough memory to run VS 2010 on the host and connect to the guest VM’s endpoints as shown above in the 4Gb of RAM my laptop has. This is by no means an optimum configuration, but it is possible to demonstrate CRM 2011 beta with SharePoint integration and write code against both SDK’s.

Tuesday, September 21, 2010

MS CRM 2011 SharePoint List Component Installation

Warning if you downloaded the file just as this was introduced it contains an unsigned assembly that will give you an error message shown when you would see it during the installation below. A fix was put out by MS a few days later. If in doubt download it again.

Download the SharePoint List Component
CRM2011-SharePointList-ENU-amd64.exe file and run it on your VM.

Accept the Conditions
image

Pick a place to unpack the contents. You will be browsing to the crmlistcomponent.wsp file from SharePoint later.

image

Before installing the List component you need to relax the Browser File Handling to “Permissive” for the Web application that you are sharing with MS CRM 2011.

Go to SharePoint Central Administration and click on Manage web applications.

image

Select the web application that you are sharing with MS CRM and click on General Settings.

image

Scroll down to Browser File Handling and click on permissive then scroll to the bottom and click OK.

image

Now visit your SharePoint Site and click on Site Actions then Site Settings.

image

Click on Solutions under Galleries

image

Click the Solutions Tab, and a ribbon will appear. Click on Upload Solution in that Ribbon.

image

Now browse to the crmlistcomponent.wsp file that was unpacked earlier and click OK.

image

Now you need to Activate this solution.

image 

Note: The error below will only happen if you are still using the Initial download of the CRM2011-SharePointList-ENU-amd64.exe file. 

image

You should see this if you have the right version.

image

The SharePoint List Component is now in place.

To test this in CRM.

Go to Settings, Document Management and click on Document Management Settings.  Enter your shared SharePoint site. Click Next

image

You can pick Account, Contact or not select where you Document Library will be based. I selected Account below.  Click Next

image

image

When it is all done, click finish.

Create a Test Account if you don’t already have one. Add a document of some kind. It will prompt you for a location to automatically create a SharePoint Folder the first time you do this per Account. Click OK.

image

Click the Open SharePoint link to see the document in SharePoint. Both sides can now work with documents in this folder.

image

Sunday, September 19, 2010

MS CRM 2011 Beta VM Continued.. Customizations

As my instructions left off, trying to publish a CRM customization and exporting customizations will fail with a SQL error. This is because the administrator currently doesn’t have adequate permissions.

Since the Administrator account has the Administrator security role this should not be an issue.

In a production system we should not be giving the Administrator account direct  access the <orgname>_MSCRM database as dbo in SQL Management Studio, but that will work for the VM. However I believe the user should instead belong to a group with the proper permissions. In this case I added the Administrator user to the SQLAccessGroup as shown below which had adequate permissions.

image

Wednesday, September 15, 2010

MS CRM 2011 Beta VM continued…

There is going to be plenty more to this VM and the CRM beta to work on as we learn more about this new release.

More Building Blocks are needed.

Using steps in the previous section make sure that the SharePoint websites are stopped.  Also stop the SharePoint services below. This will dramatically speed things up.

image

Unpack the Beta SDK

Install the CRM 2001 SDK,  using MicrosoftDynamicsCRM2011BetaSDK.exe

Double click and pick a folder to use. I chose  C:\CRM2011BETASDK

Build the Plug-in Registration Tool

Open VS 2010
Open the solution in  C:\CRM2011BETASDK\sdk\tools\pluginregistration

image

Debug the solution to make sure it works.

Enter the URL of your CRM website, and check Use Saved Credentials and click connect.

image

Click Connect again and you should see that the Plug-in Registration tool is working.

image

For testing purposes you can just run the copy out of the bin debug folder or put a copy on a folder on your desktop.

 

SQL Reporting Services ( Configure Data Source )

Now that CRM is installed we need to revisit Reporting services and configure the MS CRM_DataSource

Go to Reporting Services in Internet Explorer:
http://w2008r2crmdev/Reports 

image Click on SharedReports
Click on 5.0.xxxx
Click on Details View since the datasources are hidden by default.

image

Click on MSCRM_DataSource. (obviously adjust the following for your organization name and server name )

  1. Change the Data source type to:  Microsoft SQL Server
  2. Change the Connection string to:  Data Source=W2008R2CRMDEV;Initial Catalog=CRMDEMO_MSCRM;Connection Timeout=60;Integrated Security=SSPI
  3. Click on Windows integrated security.
  4. Click on Apply
  5. Click on Test Connection

You should see: Connection created successfully. as shown below.

image

You should now be able to test out a CRM report.
I just pulled up the Account Distribution Report at the top of the list. image

That wasn’t really impressive since this VM has almost no data in it, but there were no SSRS errors and that is the important part.

image

Sunday, September 12, 2010

Creating a MS CRM 2011 VM Part 2 of 2


Performance Note: VirtualBox allows you to set more CPU’s for your virtual machine than you should. I ended up using 3 CPU’s for my i7 although it is a hyperthreading and shows 8 cores. I found it MUCH faster set to 3 CPU’s instead of say 4.

To speed the installation up turn off the SharePoint Websites for now. Go to IIS Manager and stop the SharePoint sites. You may want to leave this off until installing the SharePoint List component in MS CRM and you will probably only want these turned on when you are using SharePoint, otherwise they
image

Visual Studio 2010 Installation

VS 2010 is a very straight forward installation. It also installs a number of other prerequisites needed for MS CRM 2011 like .NET 4.0.

Mount your VS 2010 iso image and select it.image

image

When that is complete you may want to make another snapshot of your VM.

At this point your VM’s dvi file should be about 21Gb in size.

 

Reporting Services Installation

Go to the Start button and click on All Programs

Microsoft SQL Server 2008 R2 –>Configuration Tools –> Reporting Service Configuration Manager

image

Click Connect

image

Click Web Service URL  then Click Apply

image

image 

Click on Database and Change Database

image

Create a new report server database image

Click Nextimage

Click Nextimage

Click Nextimage

Click Next

Click Finishimage

Click on Report Manager URL and click apply.

image 
Once again this is a test VM, so I gave this my Administrator account. You probably won’t be be using connectivity to remote servers anyway.image  

    image

This is good enough for the MS CRM installation to finish successfully.

 

MS CRM 2011 Beta Installation

Included in the download area is the file MicrosoftDynamicsCRM2011BetaIG.zip containing:  MicrosoftDynamicsCRM2011BetaInstallingGuide.doc

You can refer to that document if there is anything in my instructions below that you need more information about. Page 13 starts “Install Microsoft Dynamics CRM 2011 Server on a server without Microsoft Dynamics CRM installed

Start by going to you shared folder where you need to copy the CRM2011 executables that you need and copy them to the VM’s desktop. For now we just want the CRM Server and the SharePoint List component.

image

Create a CRM2011Beta folder on your desktop and click on the CRM2011-server-ENU-amd64.exe file and extract the contents into this folder.

Open the CRM2011Beta folder –> server –> amd64
Double click on setserver.exe

image

The Beta was just released so there is no point in getting any updates yet.

image

MS CRM Workgroup (5 CAL limit): FF2JM-QX9PG-HXT8M-MMHXG-4MF32
MS CRM Server (no CAL limit): 4FDTK-3HYV2-D9CCJ-4MF9Q-QJ32X

Next put in the appropriate key above.  Notice the 270 day expiration period!

image

Accept the license agreement.

Install the prerequisites.

image

image

Select an installation location or keep the default.

image

Click Next and install all of the roles.

image

Type in the name of your VM Server.
image

Click Browse and just select the top node. Click OK and Next.

image

Specifying a Security Account. For a production system you will not want  to do this, but for our demo system, just select Network service account.  There is an additional step required for the SharePoint document management feature when doing this.

image

You want to create a new website to avoid any conflict with SharePoint and other sites. Keep 5555 for the port. You should have selected 9999 for the SharePoint site if you followed the instructions.

image

We are NOT going to set up an Email router at this time. Notice the note. This can be done later.  (Setting up Exchange Server and Outlook on a test environment is worth doing especially with the new multi-tenant support in Outlook)

image

Pick an organization name for your system. It will name the Database automatically. Leave the rest alone.

image

Take the default reportserver name unless you have installed it somewhere else.

image 

Decide if you want to take part in the use experience and click Next.

image

image

Next Installation

image

image

image

It may sit like this for a while. Be patient…image

Getting close now.  Check the box to set up the SSRS extensions, and click Finish!

image

 

Installing the SSRS Connector

If you decided not to start this when the CRM installation finished. On your desktop go to the srsdataconnector folder  CRM2011Beta\server\amd64\srsdataconnector  and Double click on the file SetupSrsDataConnector.exe

image

Click Next

Accept the license agreement

 image

image  image

image

The warnings are OK for a demo, development box.  Click Next.  image

 image

image

  image

The Moment of truth….

image

At this point I shut the system down. It was apparent that it was running out of memory with 4Gb RAM. So I shut it down to make a snapshot and to increase the memory to about 6Gb to see if that was usable.

It seemed much faster after the reboot. It is interesting to note that it is only using about 2.5Gb of RAM without SharePoint running.

image

Now turn on the SharePoint Sites again.image

Create a SPList folder on your desktop. Copy the  CRM2011-SharePointList-ENU-amd64.exe  file from the Shared Folder areato the VM’s desktop and double click on it.

image

Browse to your new folder, and click OK.

image

Read the following inside the SPList folder for instructions to install the SP List Component.

Microsoft_Dynamics_CRM_2011_List_Component_Readme.htm

More to come. I have to do something else for a little while…

Good luck with the new Beta!