Beiträge getagged ‘CRM 4’

Howto: debug mailing errors

15 Februar 2010

If you are sending emails from Dynamics CRM, there is the possibility that the process of sending the mails fails. This article should give you a short overview on existing articles, which are describing the debugging details.

In order to look whether there are pending or failed mails in your system, you can use following search. As you can see, it is based on the existing view ‘My pending E-mails’. You simply have to remove the ‘Owner = current user’ condition.

If the result of this search contains mails which are in pending state since ages or have failed to send, it’s debugging time again. If you are using the Outlook Client for sending the mail, then take a look at http://blogs.msdn.com/emeadcrmsupport/archive/2009/12/18/how-to-activate-crm-4-0-platform-tracing-on-server-client-and-e-mail-router.aspx for a description on enabling the tracing.

The debugging on the E-Mail Router side is a little bit more complex, but it is explained in detail in this article http://blogs.msdn.com/benlec/archive/2008/03/25/how-to-implement-logging-for-the-microsoft-crm-4-0-e-mail-connector.aspx

System.InvalidOperationException at crm logon

17 November 2009

Today I had a service call with Microsoft CRM Support. After the import of an organization into a development system at a client, it stopped working. Trying to logon CRM via web client fails with error message:

System.InvalidOperationException: ExecuteNonQuery requires the command to have a transaction when the connection assigned to the command is in a pending local transaction. The Transaction property of the command has not been initialized.

The solution of this problem was quite simple (after the reason was found). The application pool of the system had insufficient rights for the organization database.

To get the system up and running again you have to

  1. Identify the identity of the application pool
  2. Ensure the app pool idenity has a sql user assigned for the organization database
  3. Grant the app pool identity the right db_owner on the organization database
  4. Restart IIS

Who triggered my plugin?

12 September 2009

Do you ever want to know who triggered the execution of a plugin? This knowledge is handy, if you have to do some operation if the user entered data, but not if an external application made an update with the SDK.

The IPluginExecutionContext contains the property CallerOrigin which will tell us more about the origin which triggered the plugin execution.

The CallerOrigin is populated with one of these four types

  • Application – The user has triggered the event (by creating or editing a record).
  • AsyncService – The async service triggered the event (by workflow execution).
  • WebServiceApi – An application which makes use of the crm web service triggered the event.
  • OfflineOrigin – The event was triggered by replaying offline actions while going online.

This sample shows how to make use of this property (the sample is part of the sdk article Online vs. Offline Plug-ins)

using System;
using Microsoft.Crm.Sdk;
using Microsoft.Crm.SdkTypeProxy;
 
public class OnlinePlugin : IPlugin
{
   public void Execute(IPluginExecutionContext context)
   {
      // Check to see if this is a playback context.
      CallerOrigin callerOrigin = context.CallerOrigin;
 
      if (callerOrigin is OfflineOrigin)
      {
         // This plug-in was fired from the playback queue after the user
         // selected to go online within Microsoft Dynamics CRM for Outlook.
         return;
      }
      else
      {
         // Do something here.
      }
   }
}

CRM log file locations

8 September 2009

Every part of a Microsoft Dynamics CRM implementation produces some log output. In addition to the standard logging, you could enable tracing for nearly every CRM component for debugging purposes.

This post shows where you can find these log and trace files. For enabling the generation of trace files see http://support.microsoft.com/kb/907490. Please keep in mind that although the article says that you can configure the folder in which the trace files are generated via TraceDirectory, the location is hard coded in the applications. You can set a value, but it will be ignored.

Outlook Client

  • Standard log files %APPDATA%\Microsoft\MSCRM\Logs
  • Autoupdate log files %APPDATA%\Microsoft\MSCRM\AutoUpdate
  • Trace files %APPDATA%\Microsoft\MSCRM\Traces

Note: Since Update Rollup 7, these paths are switched to the %LOCALAPPDATA% folder in order to have a smaller roaming profile.

E-Mail Router

Data Migration Manager

  • Trace files %APPDATA%\Microsoft\MSCRM\Traces

CRM Server

  • Trace files {Install dir of application}\Trace
  • Setup log files, Deployment Manager, … %APPDATA%\Microsoft\MSCRM\Logs

Event log
In addition to the log files, there is also useful information in the application event log. With the installation of CRM you get following new event sources

  • MSCRMCallout
  • MSCRMDeletionService
  • MSCRMDeployment
  • MSCRMEmail
  • MSCRMKeyArchiveManager
  • MSCRMKeyGenerator
  • MSCRMKeyService
  • MSCRMLocatorService
  • MSCRMPerfCounters
  • MSCRMPlatform
  • MSCRMReporting
  • MSCRMTracing
  • MSCRMWebService

Update
Added note for Outlook Client log paths for version Rollup 7 or higher