Thursday, December 1, 2011

Windows 8 in a VM

I finally got my VM NAT working thanks to the comments in an installation blog post. The key was changing the Adapter Type (Network - Advanced) to Intel PRO /1000 MT Desktop. As soon as I restarted the VM, it recognized the adapter.

Windows 8 on my Dell Duo has COMPLETELY REVOLUTIONIZED my tablet. With Windows 7, the Duo was better in "netbook mode" but now I rarely flip to the keyboard. The split on-screen keyboard is a huge improvement and the pinch-zoom on IE 10 is FANTASTIC.

Wednesday, September 7, 2011

Supported Extensions for CRM 2011

I thought it was worth highlighting the official Do’s and Don’ts of CRM extension.


It seems obvious, but no modifying the physical database schema is permitted (except indexes):

Modifications to the physical schema of the database, other than adding or updating indexes. This includes any actions performed against the database without going through System Customization. Modifying tables, stored procedures, or views in the database is not supported. Adding tables, stored procedures, or views to the database is also not supported because of referential integrity or upgrade issues. Adding indexes is supported per the guidelines in the “Microsoft Dynamics CRM 2011 Implementation Guide”. This applies to all Microsoft Dynamics CRM databases and the Microsoft Dynamics CRM for Microsoft Office Outlook local database.


One infraction that I have seen cause disastrous results is saved for last:

Editing a solutions file to edit any solution components other than Ribbons, Forms, SiteMap or Saved Queries not supported. Defining new solution components by editing the solutions file is not supported. Editing Web Resource files exported with a solution is not supported. Editing the contents of a managed solution is not supported.

Wednesday, August 17, 2011

TFS Build Service Tips

My organization is hosting TFS for multiple customers.  To keep everyone isolated (and happy) we have multiple Team Project Collections, but the downside is we need to setup a separate Build Controller for each Site Collection (see MSDN article for more pros/cons).  TFS 2010 changed to only allow a 1 to 1 pairing between a TFS Collection and a Build Controller.


Setting up a Build Controller is fairly straightforward.  Here are some tips that I have found helpful:

1.       Create an AD account for the service.  It’s easier to grant permissions to output folders and network shares using named users/groups.  Do this before running the Build Controller wizard – it will add the necessary groups and permissions for you.

2.       Run the TFS Setup and only select “Build Controller” for the install.

3.       Use the Build Controller wizard at the end of the install to connect to your Team Project Collection.

4.       If Visual Studio is not installed on the Build Controller, copy the MS Build targets from a developer machine to:
  C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0

5.       Add a Build project to copy our compiled output to an integration server (see example file below)


<?xml version="1.0" encoding="utf-8"?>

<Project xmlns="">


    <MySourceFiles Include="$(OutDir)_PublishedWebsites\<Your Web Project>\**\*.*" />


  <Target Name="CopyFiles">



        DestinationFolder="\\<Network Share>"






Wednesday, July 20, 2011

CRM ideas and products I discovered at WPC 2011

CRM Solutions

There are some new change management options available in CRM 2011.  With Managed Solutions, you can achieve a layered effect where one solution builds on the next and it is even possible to isolate and rollback individual solutions.  This is particularly important for teams that have multiple simultaneous development projects proceeding at different rates/release dates.  There is a good discussion of the implications of solutions as well as fundamentals of the entire CRM development spectrum in the new CRM Developer’s Training Kit.  This is tricky stuff, so make sure you get it working in a “sandbox” before trying this in your main Dev branch.

CRM Marketplace

I just attended the Microsoft Worldwide Partner Conference where I had the chance to talk to a number of ISVs and Microsoft engineers.  There are a lot of cool products emerging around the CRM platform.  There are two products that I am particularly keen to try out: NeuDesic’s Pulse and ADX Studios portals.

Pulse is a way to bring social-like conversations into CRM and SharePoint and looks like it would have fantastic application wherever team collaboration is going on.

ADX Studios (makers of the LINQ based SDK that Microsoft ships with CRM) has a number of ready-to-run public facing portals that have built-in claims based authentication to re-use Facebook, Google, and Live accounts.

Plugins, Workflows and Dialogs

Finally, I just came across this helpful CRM team blog post that outlines the best time to use a plugin vs workflow.

Wednesday, July 6, 2011

Synchronizing CRM Records in Outlook using Local Data Groups

My customer wanted to have all the Contacts owned by their Business Unit synchronized to Outlook and that is easily accomplished using the Local Data Groups feature!

Friday, July 1, 2011

Bing Map Browser for CRM 2011

There is a very usable Silverlight Bing Map Browser on Codeplex.  The documentation is a little light so here are a couple of tips on setup:


There are two different HTML resources

1.       LocateAddress – this is used on a form like Contact to find the Lat/Lon of an address

2.       BingMapBrowser – this is the control that maps multiple records based on the FetchXML you configure


Mapping a Contact

I followed the “configure entity form” instructions and added the web resource in a section on a new Contact form.  One thing that was confusing to me, the control only works with Lat/Lon BUT it will do an address lookup and enter Lat/Lon on your Contact form if you press the “FillLatLong” button.


Mapping multiple records

I left the default BingMapConfig.xml settings and the browser mapped all my Contacts and Accounts.  You can test it by clicking on the link in the URL property of the BingMapBrowser web resource.   To add a link in the left nav, you need to export and modify your Sitemap (WARNING: always keep a backup copy).  I added “Maps” to the Workplace bar:

          <SubArea Id="nav_maps" Url="$webresource:new_BingMapBrowser" >


              <Title LCID="1033" Title="Maps"/>



Wednesday, June 29, 2011

Cool OneNote feature

I was already very impressed by OneNote, but I am blown-away after stumbling upon the built-in OCR capability.  When I did a content search for “Attendee” it not only found the image, it even highlighted the word on the image!


Monday, June 27, 2011

Removing the Dell DataSafe Upgrade Discount pop-up

I was baffled by a Dell product pop-up that did not appear to have a way to disable/ignore it...until I unlocked the taskbar and resized it. After that, the entire ad was displayed, including the option "Don't remind me of dicount offerings". Now if I can just get Dell to reimburse 30 minutes of life.

Wednesday, June 22, 2011

Mail Merge Templates No Entity error

I removed an entity that we were no longer using, but the Mail Merge Templates were still there.  CRM throws an error when there are templates that are missing their entity.  I discovered this by running the CRM Diag Tool and the CRM Trace Log Viewer.


To fix this, I had to manually set the records to “deleted” in the CRM database (DeletionStateCode=1).  Lesson learned: remove Mail Templates before deleting an entity!




Thursday, June 2, 2011

Oracle regexp_replace function

I needed to remove non-ASCII characters from an Oracle column and this regular expression did the trick nicely:


update TABLE set COLUMN = regexp_replace( COLUMN,'[^a-z,_, ,A-Z,0-9,@,&,$,:,.,%,'']','');



Friday, May 20, 2011

CRM 4.0 SRS Connector "Same Account" Setup Error

After performing my steps for troubleshooting SSRS issues in CRM, I realized my CRM environment was having a double-hop error saying

Cannot create a connection to data source 'Portal'.

Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'


I was getting an error while trying to install the CRM SRS Connector:

A Microsoft Dynamics CRM Server component is using the same account as the instance of SQL Server Reporting Services


My SSRS Service was running as Network Service.  I changed it to run as an AD user account that has database permissions and that took care of the setup error and SRS connector completed.


After changing the CRM SSRS Data Source I got an error saying:

Login credentials not being passed for one or more data source


Then I remembered my CRM was on Rollup 11, so I installed the SRS Rollup 11.  After an IISRESET my reports finally came up.

Tuesday, May 10, 2011

Rendering HTML in SSRS 2008 Reports

Some of the data in my report was stored with simple HTML formatting tags.  It turns out that the expressions I had on my report was already a “placeholder” and SSRS Placeholders have the ability to set the Markup Type to “HTML – Interpret HTML tags as styles”.

Note:  I had to click THREE times on the expression to drill past the Rectangle and Text Box containers to finally select the expression placeholder.

Tuesday, March 22, 2011

SOLVED: Connecting to Team Foundation Server 2010 (TFS 2010) from Visual Studio 2008 (VS2008)

It took two different forum posts for me to get this working, so this deserves permanent blog recognition.  The key was that Visual Studio 2008 doesn’t have a concept of TFS “Collections” so you have to help it by providing the URL to the exact collection you are connecting to.  Not sure what the URL is?  Open up the collection in VS 2010 and copy the URL property in the Collection Properties.  Here are the steps from the forum post:

To connect to TFS 2010 using VS2008, you need to install the below components in mentioned order. The Installation order is really important to make it work.

- Install Visual Studio 2008
- Install Team Explorer 2008
- Install Visual Studio 2008 SP1 (This will upgrade both VS2008 and Team Explorer 2008 to SP1)
- Install VSTS 2008 Forward Compatibility Update

As TFS2010 introduces the notion of Team Project Collections. After the installation is completed successfully, you should provide the entire URL to connect TFS2010 server.

You can express the connection string as follows:

http://<serverName>:<port>/<vdir>/<collectionName> (e.g. http://TfsServer:8080/Tfs/ProjectCollectionName )

The <vdir> is an optional path for the TFS web sites specified by the administrator during setup. By default it is “tfs”.


Thursday, March 10, 2011

Hiding Custom ISV.Config Buttons in CRM 4.0

I needed to hide/show my ISV.config buttons (note the ToolTip is the key here):

 <Entity name="new_myentity">  
<Button AccessKey="P" Icon="/_imgs/button_approve.ico"
ValidForCreate="1" ValidForUpdate="1"
<Title LCID="1033" Text="Approve" />
<ToolTip LCID="1033" Text="Approve"/>

So I found some sources that led me to this function that I call in the Entity’s OnLoad event:

 // hide ISV buttons that don't apply

function hideISVButton(buttonTitle) {
var comps = document.getElementsByTagName('li');
for (var i = 0; i < comps.length; i++) {
if (comps[i].title == buttonTitle)
comps[i].style.display = "none";

***Interesting to note about the ISV.Config JavaScript…it calls a function that is also defined in the Entity’s OnLoad…a much cleaner alternative to real JS in the ISV.Config file:

 ApproveApplication = function() {

// Your function code here


Wednesday, March 9, 2011

Fun with Enums: Calculate next Monday

I needed to calculate a couple of interesting dates for the Notary system.


Next Monday:
  DateTime.Now.AddDays(8 - (int)DateTime.Now.DayOfWeek)

The last day of the birth month, 4 years from now:
  new DateTime(DateTime.Now.Year + 4, dobDt.Month, 1).AddMonths(1).AddDays(-1);

Tuesday, March 1, 2011

Scribe Console Access Denied Error

Today I tried to create an Integration Process for a new DTS I had just finished, but every time the Console tried to access the file system I got an “Access Denied” error.  Turned out that restarting the Scribe AdminServer restored whatever permissions the Console needed.

Wednesday, February 16, 2011

Date Validation is SSIS

I needed to import a large amount of data from an Access database and the standard SQL Server Management Studio would fail when it ran into a record with a bad date.  I ended up saving the import as an SSIS package (file system) and then editing the DTSX file.  I was able to override bad dates to Null by adding a Derived Column with a date validation that replaced the existing column in the dataset. 

Full SSIS validation expression:


((DT_Date)Date_to_validate < (DT_DATE)"1753-1-1") ? NULL(DT_DATE) : (DT_Date)Date_to_validate

Thursday, February 10, 2011

CRM Outlook Client Error "input string was not in a correct format"


I ran into an issue with the CRM Outlook client configuration wizard that turned out to be a quick registry edit:


Set sPositiveSign to “+” at


HKEY_CURRENT_USER.Control Panel.International


Make sure to update the Default and all profiles under HKEY_USERS if the person running RegEdit is not the actual user (e.g. a desktop support person)

Wednesday, February 2, 2011

Automate your CRM Plugin deployment using the PluginDeveloper

Automating the Plugin deployment process has helped our team reduce errors and speed
up the development and debugging of our custom plugins and workflows.  Using
a combination of the PluginDeveloper included in the SDK (<sdk install>\tools\plugindeveloper\),
a batch file, and
configuring an external tool in Visual Studio allows our CRM build manager to deploy
plugins to Dev, Test or Production directly from Visual Studio.

Our team uses separate register.xml files for Dev, Test and Prod that are
set in Visual Studio to Copy always in the Copy to Output Directory
in the Visual Studio’s File Properties window.  The batch file copies
the project’s output directory to the PluginDeveloper’s directory and
prompts the user to select which environment to deploy to.

Build the PluginDeveloper Executable

1.      Follow the Readme.doc in the project root.

2.      Copy the RunPD.bat file to the PluginDeveloper.exe’s
location (we use a common file system path \CRM\tools\PluginDeveloper)

Configuring Visual Studio’s External Tools

1.      Select the Tools – External Tools …

2.      Click Add and enter the details for the batch file

a.      For Arguments specify $(BinDir) for select Binary
from the options

Create register.xml Files for Each CRM Environment

1.      The batch file expects to find files named:

a.      DEV register.xml

b.     TEST register.xml

c.      register.xml

Running the Tool from Visual Studio

1.      Select Tools – Run Plugin Developer

2.      At the menu, type 1,2 or 3 for the desired environment and
press Enter

3.      Enter password when prompted

*Credit goes to for
the menu framework

Friday, January 28, 2011

Fool Proof Data Imports in CRM

Sometimes it can be a challenge to get the data maps to work properly, but using the “Automatic” map is almost foolproof.  Follow these basic steps:

1.       Create an advanced find with all of the entity’s “custom columns” (ignore CRM columns like created by, status, etc)

2.       Export the results to Excel and remove the hidden GUID column (Column A)

3.       Using the exported data as a guide for picklist values, insert the new data

4.       Run the Import wizard.  You should see “Automatic” in the Data Map

Thursday, January 20, 2011

CRM 4.0 Required TCP Ports

I was trying to install CRM on a Server 2003 connecting to SQL 2008 and ran into this error:

The warning message:
|Warning| Check SqlServerAgentValidator : Warning: Setup was unable to verify that SQL Server Agent (SqlAgent$crm) was running.

The error message:
|  Error| Check CrmSqlDomainValidator : Failure: The SQL Server ‘{0}’ is unavailable.

Windows Server 2003 requires TCP/UDP port 445 to be open between CRM and the Database.  Once the firewall was opened, the installation went off without a hitch.  In my experience with Server 2008, this port was not required.  Microsoft has a comprehensive port list, but my list is below:


Ports I request for CRM on Server 2008 installs:

TCP 1433

TCP 135


Ports I request [now] for CRM on Server 2003 installs:

TCP 1433

TCP 135


Using CRM's TargetRetrieveDynamic to retrieve a DynamicEntity via Guid

This is a snippet from the SDK example: <sdk loction>\sdk\server\reference\cs\crmservice\dynamicentityretrieve.cs


            // Create the retrieve target.

            TargetRetrieveDynamic targetRetrieve = new TargetRetrieveDynamic();


            // Set the properties of the target.

            targetRetrieve.EntityName =;

            targetRetrieve.EntityId =;


            // Create the request object.

            RetrieveRequest retrieve = new RetrieveRequest();


            // Set the properties of the request object.

            retrieve.Target = targetRetrieve;

            retrieve.ColumnSet = new AllColumns();


            // Indicate that the BusinessEntity should be retrieved as a DynamicEntity.

            retrieve.ReturnDynamicEntities = true;


            // Execute the request.

            RetrieveResponse retrieved = (RetrieveResponse)service.Execute(retrieve);


           // Extract the DynamicEntity from the request.

            DynamicEntity entity = (DynamicEntity)retrieved.BusinessEntity;


Saturday, January 15, 2011

Troubleshooting CRM SSRS Errors

I had a perfectly happy production CRM environment humming along nicely…until I tried to install a second CRM instance that used the same SSRS server.  After the install (and rebooting the SSRS server), my production reports stopped working and the new CRM’s reports we’re not working either. 

I went through an episode of this w/ MS Premier Support during the first CRM install and I remembered some of the troubleshooting steps we took back then. 


The first thing I tried was to enable remote errors in SSRS.  That only helped a little because CRM still displayed the friendly error page, “Report cannot be displayed”.  To have CRM give me the detailed error message I had to set the DevErrors key to “true” in the CRM Web.Config and now I can see the error.  After adding the SSRS service account to my new CRM’s AD Group PrivReportingGroup and restarting the SSRS service, my “new” CRM reports started working, but the old ones were still broken.  Opening Regedit on the SSRS server to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSCRM I can see my configdb key is pointing to the wrong server (this is what the CRM Data Connecor uses).  When I changed that key back to my production database instance (similar to the procedure for moving a CRM database) and rebooting my SSRS server, the reports worked again.



Step One – Enable Remote Errors on SSRS

Step Two – Change CRM Web.Config DevErrors key to “On”

Step Three – Check the Active Directory groups (Start  -- Run -- DSA.MSC )

Step Four – Check Registry Keys


Microsoft support confirmed my predicament.  To do what I want (two CRMs on one SSRS server) I need to install a second SSRS instance.

Friday, January 7, 2011

Setting the Primary Key of a Custom Entity in a Plugin

I needed to set the primary key Guid on a custom entity in the Pre stage of a Plugin.  It required adding a KeyProperty to my DynamicEntity.


    Guid requestId = Guid.NewGuid();

    Key newReqKey = new Key(requestId);


    entity.Properties.Add(new KeyProperty("new_myentityid", newReqKey));


Troubleshooting CRM Entity Publish Errors

Here are a few things to keep in mind when working w/ entities in CRM

1.       When you export your entities, make sure you export all N:1 related entities.  When you select an entity and click export, there is a warning dialogue that reminds you of this, but nobody reads it.

2.       Make sure you have Published your entities after importing them.  I had an entity that was “broken”, but I couldn’t delete it until I had published it.  Running a query like this will help you determine if your entity has been published: SELECT * FROM OrganizationUIBase  WHERE ObjectTypeCode = <offending entity code>.

3.       Finally, if you cannot delete a published entity, Compare the fields in the Form with the entity attributes.  Microsoft Support gave me a tool to run a FormXML comparison.  Two times now there has been an attribute in the form was missing from the entity. Once you add the attribute back (type doesn’t matter), you can delete the entity and start fresh.