Error: Deletion Service failed to clean up some tables

Some people have been experiencing the following error message in the event log:

Event Type: Error
Event Source: MSCRMDeletionService
Event Category: None
Event ID: 16387
Date: Date
Time: Time
AM User: N/A
Computer: Computer_Name
Description:
Error: Deletion Service failed to clean up some tables.

Microsoft has a solution for this message. See http://support.microsoft.com/kb/921391/EN-US/ for their solution.

Personally I don't feel comfortable with the solution they give. They are removing the enforced relationships for the tables which cause the issue. This will leave you with orphaned records in your database and probably the same issue when you upgrade to the upcoming titan release. Here are my steps to correctly fix this issue (partly copied from the MS solution) :

To identify the table where the Deletion Service is failing, follow these steps:
1. On the Microsoft Dynamics CRM server, click Start, click Run, type cmd, and then click OK.
2. At the command prompt, locate the system drive, locate the program files, locate Microsoft Dynamics CRM, locate the server, locate the bin, type crmdeletionservice.exe –runonce, and then press ENTER. You then receive a message that resembles the following message:
Can't clean up the following tables: Campaign

Note The table that is returned in the message is the table for which the Deletion Service failed.

The following example demonstrates how to resolve this problem for the Campaign table.

To resolve the problem for the Campaign table, follow these steps:
1. Run a statement in Microsoft SQL Query Analyzer. To do this, follow these steps:
a. Click Start, point to All Programs, point to Microsoft SQL Server, and then click Query Analyzer.
b. Run the following query against the Organization Name_MSCRM database.
delete from Campaign where DeletionStateCode = 2
This query returns a message that resembles the following message:

DELETE statement conflicted with COLUMN REFERENCE constraint 'campaign_leads'.

2. Run two queries agains the Organization Name_MSCRM database.
delete from [table name in message] where [column name in message] in (select campaignid from Campaign where DeletionStateCode = 2)

delete from Campaign where DeletionStateCode = 2

By doing this, you do delete the associated records as well. Keep in mind that once deleted, you cannot get the data back. Therefore always make a backup first!



MSCRM Mobile Applications

Microsoft does offer 2 different applications for the mobile devices. These are the Microsoft Dynamics CRM 3.0 Mobile client (in short the CRM Mobile client) and the CRM Mobile Express for Microsoft Dynamics CRM 3.0 (Mobile Express client). Next to these two applications there is the CWR Mobility's Mobile CRM client (CWR Mobile client). Now which application to use?

Lets look at the descriptions for each client:

Microsoft Dynamics CRM 3.0 Mobile application
Microsoft CRM Mobile provides salespeople with up-to-date information about their accounts and contacts, and helps them manage sales opportunities and track sales-related activities.

Salespeople select the data to take with them on the road. While disconnected, they can enter data related to their sales activities. Salespeople can synchronize data with the Microsoft CRM server when the network is available, either when the user is on the office network, or when wireless access is available through CDMA or GPRS/Edge. The data entry forms and views can be customized for your business.

CRM Mobile Express for Microsoft Dynamics CRM 3.0
CRM Mobile Express for Microsoft Dynamics CRM 3.0 is a shared-source initiative sponsored by Microsoft that offers a lightweight, mobile browser client for viewing and editing data in Microsoft Dynamics CRM 3.0. Now you can manage important Sales, Service and Marketing information from your Windows Mobile, Smartphone and HTML 4.0 compatible devices! CRM Mobile Express for Microsoft CRM also includes a Microsoft Dynamics CRM 3.0 Administration Console that can be used to customize your mobile data objects - such as adding custom CRM entities to CRM Mobile Express, set data object read and write permissions, and configure mobile forms according to your CRM system's design. This community project comes complete with three documents - an Installation guide, a User guide and a Developer guide, as well as the application source code for both the CRM Mobile Express Client and Administration Console applications. Developers can use Visual Studio.net 2005 to extend and modify both applications as they see fit.

CWR Mobile CRM by CWR Mobility
CWR Mobile CRM delivers:
- Access to Dynamics CRM 3.0 while out of the office – allowing for up-to-the-minute data changes (from the field and the office) and instant access to current data.
- A user-friendly interface on the Windows Mobile devices for intuitive CRM data access and entry by the mobile professional. Both while the device is connected online to a wireless service provider and offline, such as in an airplane, or deep inside a customer’s warehouse

Using CWR Mobility's Mobile CRM, sales and service teams have instant access to important customer information when and where they need it.

Differences
There are some factors which would influence the result on which application to use. These factors include:
- Out of the box functionality
- Extensibility
- Offline support
- Client Requirements
- Language support
- Price

Out of the box functionality
When comparing the functionality out of the box, then the CWR Mobile client gets the highest score. It supports all (custom) entities, (custom) attributes, a very efficient synchronisation mechanism, field level security via configuration and a lot of minor, but useful features like: direct calling the phonenumber on the screen and TomTom integration.

The Mobile Express client misses the paging functionality out of the box.

Extensibility
Both the Mobile Express client as well as the CWR Mobile client have good possibilities for extensions. The Mobile Express client is a shared source initiative which offers all the code which can be extended. The CWR application supports the addition of custom build controls and client side business logic. Of course these extensions should be developed by professional developers.

Offline support
The CWR Mobile client support Online as well as Offline modes (network aware). The CRM Mobile client supports only Offline mode with a manual sync. The Mobile Express client only supports Online mode.

Client requirements
The Mobile Express client only requires a HTML 4.0 compatible device. If Blackbarry support is required, then this is the only supported application.

The CRM Mobile client as well as the CWR Mobile client requires Windows Mobile or PocketPC. The CWR Mobile client requires a screen resolution of 240x240 and 48mb ram. The CRM Mobile client requires a screen resolution of 240x320 and 64mb ram.

Language support
The CWR Mobile application supports all supported Microsoft CRM languages. They also allow more languages to be added if required. The Mobile Express client supports all CRM languages and the CRM Mobile Client supports only the languages English, German, French and Spanisch.

Price
The price depends on the cost of the product and the additional costs for customization by a partner. Here are listed the prices of the product. Prices of customization are variable.

The CRM Mobile client as well as the Mobile Express client are available for free. The current list price of the CWR Mobile client is €299 per mobile user.

Overall conclusion
By using a mobile application for MS CRM, you will be able to increase your sales. You are able to react very quickly to questions you get from customers and you can check the latest information just before you enter the clients room.

In the part above I have shown my experiences with these applications. In my point of view, the CWR Mobile application deliveres the best functionality. It supports everything that I expect a mobile application should support: network aware data access (online and offline), all languages, entities, custom entities and integration with many other applications on the client device. The price of the product is very reasonable and the quality you'll get for it is very good.

More Information
Microsoft Dynamics CRM 3.0 Mobile:
http://www.microsoft.com/downloads/details.aspx?FamilyID=ea5a3566-7ec8-4afe-bbfa-91e7210c55c4&DisplayLang=en

CRM Mobile Express for Microsoft Dynamics CRM 3.0:
http://www.gotdotnet.com/codegallery/codegallery.aspx?id=8e65fc13-4073-406c-879c-442faf78f2c8

CWR Mobility's Mobile CRM: http://www.cwrmobility.com/Products/CWRMobilitysCRM30Mobile/tabid/73/Default.aspx



Enable or disable advanced find feature on attributes

Did you know that you can set each attribute of each entity to be able for advanced find or not?

By doing this you can specify which fields the users can search on. That means that all the fields which you do not use in your CRM system can be removed from the list to make using the advanced find easier.

So how do you do this? Just:
- go to system
- customizations
- customize entities
- select any entity
- go to the tab attributes
- select any attribute
- swich the flag 'Searchable'

Hm? You dont have that flag? Go get it at: http://support.microsoft.com/kb/912061/EN-US/

Good luck!



Accessing webservices via Javascript (aka AJAX)

Several times I've been asked, or saw the question on the newsgroups, how to create a piece of javascript code which retrieves data from a webservice. This information has been included in the SDK and you'll be able to find it here:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/CrmSdk3_0/htm/v3d0accessingwebservices.asp

Here's the code example of that page:


// Declare variables.
var i=0; var j=0; var k=0; var r=0;
var serverUrl = "http://www.webservicex.net";

// This is the picklist.
switch (parseInt(event.srcElement.DataValue, 10))
{
case 1:
i = "JPY";
break;
case 2:
i = "GBP";
break;
case 3:
i = "EUR";
break;
}

// Instantiate at connection to the Web service and call the get method.
var xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");

xmlhttp.open("get", serverUrl + "/CurrencyConvertor.asmx/ConversionRate?FromCurrency=USD&ToCurrency="+escape(i), false);
xmlhttp.send();
var startTag = "<double xmlns=\"http://www.webserviceX.NET/\">";
var endTag = "</double>";
var exch;
var valueStart = 0;
var valueEnd = 0;

// Parse the returned XML string.
valueStart = xmlhttp.responseXML.xml.indexOf(startTag, valueEnd) + startTag.length;

valueEnd = xmlhttp.responseXml.xml.indexOf(endTag, valueEnd+1);
exch = xmlhttp.responseXML.xml.substring(valueStart, valueEnd);

// Set the Exchange rate on the custom attribute.
crmForm.all.fabrikam_exchangerate.DataValue = parseFloat (exch);
j = crmForm.all.totalamount.DataValue;
var kk = j*(parseFloat(exch));

// Calculate and set the total sum in the selected currency.
crmForm.all.fabrikam_totalcurrency.DataValue = kk;



Clone your production system: VMware Converter 3.0

Imagine you have a problem on your production server. You try to reproduce the error on your dev, test and acceptance servers and they all work fine... Now what? How do you solve this? I really don't like to debug errors on the production machine..

VMware has the solution! They have created a free Physical to Virtual Convertion tool which does not require your server to go offline! They're currently in beta test, but will release within approximately 6 months with the final version.

What Is VMware Converter?
VMware Converter is a highly robust and scalable enterprise-class migration tool that reduces the time that IT managers spend converting physical machines to VMware virtual machines. Using a snapshot based cloning mechanism that is extremely fast and reliable, VMware Converter enables remote conversions without disrupting the source server during the conversion process.

For more information:
http://www.vmware.com/products/beta/converter/

If you can't wait until this product has been released, then you can work with VSMT, but you do need deep knowledge of AD, DNS etc.

The tool VSMT is developed by Microsoft and it works with Virtual Server and ADS. See this url for more information:
http://www.microsoft.com/windowsserversystem/virtualserver/evaluation/vsmt.mspx



BizTalk Adapter available for download!

It's been some time waiting since the announcement at the Convergence in Texas for the BizTalk Adapter to be released, but it has gone public! Here are links to the adapter and a code sample:
The adapter
Code Sample

This BizTalk connector basically exposes all the CRM API's in BizTalk. For each entity schemas can be generated. The adapter can perform Create, Update, Delete or Execute actions based on the input.

I've been using the beta of this adapter for creating integrations with several other systems. Some integrations I have been working on already:
- Lead entry via email: POP3, BizTalk, MSCRM
- Continuous integration with financial system: Webservice, BizTalk, MSCRM
- Daily bulk import of data: SQL, BizTalk, MSCRM

Drop me a note if you'd like me to post a howto regarding this Adapter.

Have fun integrating CRM!



Determine which priviledges are required

I do assume that you do not provide the end user administrator rights on the crm installation. You probably have defined your own security role with the least priviledges the user should posess. Well how do you know what priviledges the user should posess?

There's an update to the online SDK with this information. You can browse to this url and you'll see a list of messages. Under each message the required priviledges are listed.

Now if you have a question like "Which priviledges are required for adding facilities to a resource group?" can be answered with a visit to that page.