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
Directory
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 DosTips.com 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

TCP/UDP 445

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 = EntityName.contact.ToString();

            targetRetrieve.EntityId = created.id;

 

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

 

Summary:

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.