April 2010


Error message when you try to log on to Microsoft Dynamics CRM 4.0: “Cannot open database ‘[Organization]_MSCRM’ requested by the login”

You install Microsoft Dynamics CRM 4.0. When you try to log on to Microsoft Dynamics CRM 4.0, you receive the following error message:
Cannot open database “Organization_MSCRM” requested by the login.
The login failed. Login failed for user ‘NT AUTHORITY\NETWORK SERVICE’.

If the DevErrors value is set to On in the Web.config file, you receive an error message that resembles the following:

Server Error in ‘/’ Application.

Cannot open database “MSCRM_CONFIG” requested by the login. The login failed.
Login failed for user ‘Domain\CRMServer‘.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: Cannot open database “MSCRM_CONFIG” requested by the login. The login failed. Login failed for user ‘Domain\CRMServer‘.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[SqlException (0x80131904): Cannot open database "MSCRM_CONFIG" requested by the login. The login failed.
Login failed for user 'Domain\CRMServer'.]

System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) +437

System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +82

System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +105
System.Data.SqlClient.SqlConnection.Open() +111
Microsoft.Crm.CrmDbConnection.Open() +386

Microsoft.Crm.SharedDatabase.DatabaseMetadata.LoadMetadataXmlFromDatabase(CrmDBConnectionType connectionType, String connectionString, Int32& maxBlobSize) +125

Microsoft.Crm.SharedDatabase.DatabaseMetadata.LoadCacheFromDatabase(CrmDBConnectionType connectionType, String connectionString) +65
Microsoft.Crm.ConfigurationDatabase.ConfigurationMetadata.LoadCache() +41
Microsoft.Crm.ConfigurationDatabase.ConfigurationMetadata.get_Cache() +114

Microsoft.Crm.ConfigurationDatabase.ConfigurationDatabaseService.InitializeMetadataCache() +28
Microsoft.Crm.SharedDatabase.DatabaseService.Initialize(String tableName) +53
Microsoft.Crm.SharedDatabase.DatabaseService.Retrieve(String tableName, String[] columns, PropertyBag[] conditions) +109
Microsoft.Crm.ServerLocatorService.GetSiteSettingIdFromDatabase() +155
Microsoft.Crm.ServerLocatorService.GetSiteSettingId() +187
Microsoft.Crm.ServerLocatorService.GetSiteSetting(String settingName) +82
Microsoft.Crm.LocatorService.GetSiteSetting(String settingName) +35
Microsoft.Crm.CrmTrace.get_RefreshTrace() +654

Version Information: Microsoft .NET Framework Version:2.0.50727.832; ASP.NET Version:2.0.50727.832

CAUSE

This problem occurs if one or more of the following conditions are true: You ins…

//

This problem occurs if one or more of the following conditions are true:

  • You install Microsoft Dynamics CRM 4.0 in a multiple-server environment. Then, you install Microsoft Dynamics CRM 4.0 directly on a server that is running Microsoft SQL Server. However, some SQL Server permissions are not set.
  • The Microsoft Dynamics CRM 4.0 server is not added to the SQLAccessGroup group in the Active Directory directory service.

RESOLUTION

To resolve this problem, use one or more of the following methods. Method 1Set u…

//

To resolve this problem, use one or more of the following methods.

Method 1

// Set up the NT AUTHORITY\NETWORK SERVICE account as a SQL Server user who has access to the Microsoft Dynamics CRM 4.0 databases. To do this, follow these steps:

  1. Click Start, point to All Programs, point to Microsoft SQL Server 2005, and then click SQL Management Studio.
  2. To log on to SQL Server Management Studio, click OK.
  3. In Object Explorer, expand Databases, expand the Organization_MSCRM database, and then expand Security.
  4. Right-click Users, and then click New User.
  5. In the Database User – New dialog box, type NT AUTHORITY\NETWORK SERVICE in the following fields:
    • The User name field
    • The Login name field
  6. In the Database role membership area, click to select the db_owner check box, and then click OK.

Method 2

// Add the Microsoft Dynamics CRM 4.0 server to the SQLAccessGroup group in Active Directory. To do this, follow these steps:

  1. Click Start, click Run, type dsa.msc, and then click OK.
  2. Click the organizational unit in which you install Microsoft Dynamics CRM 4.0.
  3. Double-click SQLAccessGroup.
  4. In the SQLAccessGroup dialog box, click Members, click Add, click Object Types, click to select the Computers check box, and then click OK.
  5. In the Enter the object names to select box, type the name of the Microsoft Dynamics CRM 4.0 server, and then click Check Names.
  6. Verify that the name of the Microsoft Dynamics CRM 4.0 server in the Enter the object names to select box is available, and then click OK two times.
  7. Restart the Microsoft Dynamics CRM 4.0 server.

Error message when you run a report in Microsoft Dynamics CRM 4.0: “The report cannot be displayed”

Solution:

Manually change the connection string and the data sources that must be changed. To do this, follow these steps:

  1. Open Reports Manager.
  2. Select the CRM Organization.
  3. Click Show Details.
  4. Click the v4 folder.
  5. Click the CRM Data Source.

    When you are using Windows Authentication, the connection string will resemble the following:

    Data Source=server;Initial Catalog=ORG_MSCRM;Integrated Security=SSPI
    With Windows integrated authentication radio selected.

    When you use Microsoft CRM Data Extension, the connection string resembles the following:

    MSCRM Data Connector Connection String
    With Credentials Supplied by the user running the Report.

Error message when you run a report in Microsoft Dynamics CRM 4.0: “Reporting Error. The report cannot be displayed”

Solution:

If SQL Reporting Services and the SQL databases are installed on the same server and the account identified in step 1 is Local System, follow these steps:

  1. Start SQL Server Management Studio. To do this, click on the Start button, and then point to All Programs, point to Microsoft SQL Server 2005, and then click SQL Server Management Studio.
  2. Expand Security, expand logins, right-click NT AUTHORITY\SYSTEM, and then click Properties.
  3. Click User Mappings.
  4. Click to select the Organization_name_MSCRM check box, and then click to select the public check box and the CRMReaderRole check box.

    Note The Organization_name placeholder is a placeholder for the actual organization name.

  5. Click to select the MSCRM_Config check box, and then click to select the public check box and the CRMReaderRole check box.
  6. Click OK.

If SQL Reporting Services and the SQL Server databases are installed on separate servers and the account identified in step 1 is Network Service or Local System, follow these steps:

  1. a. Open Active Directory Users and Computers and verify that the SQL Reporting Services computer account is a member of the SQLAccessGroup that was created by the installation of Microsoft Dynamics CRM.
  2. Start SQL Server Management Studio. To do this, click on theStart button, and then point to All Programs, point to Microsoft SQL Server 2005, and then click SQL Server Management Studio.
  3. Expand Security, expand logins, right-click SQLAccessGroup, and then click Properties.
  4. Click User Mappings.
  5. Click to select the Organization_name_MSCRM check box, and then click to select the public check box and the CRMReaderRole check box.

    Note The Organization_name placeholder is a placeholder for the actual organization name.

  6. Click to select the MSCRM_Config check box, and then click to select the public check box and the CRMReaderRole check box.
  7. Click OK.

Complete the following steps if SQL Reporting Services is running as a domain user account:

  1. Open Active Directory Users and Computers and verify that the user account identified in Step 1 is a member of the SQLAccessGroup that was created by the installation of Microsoft Dynamics CRM.
  2. Start SQL Server Management Studio. To do this, click Start, point to All Programs, point to Microsoft SQL Server 2005, and then click SQL Server Management Studio.
  3. Expand Security, expand logins, right-click SQLAccessGroup, and then click Properties.
  4. Click User Mappings.
  5. Click to select the Organization_name_MSCRM check box, and then click to select the public check box and the CRMReaderRole check box.

    Note The Organization_name placeholder is a placeholder for the actual organization name.

  6. Click to select the MSCRM_Config check box, and then click to select the public check box and the CRMReaderRole check box.
  7. Click OK.

To remove the highlighted icon labels!


1) Right click on your desktop,  -> select properties,->  select desktop,  -> click customize desktop, -> then choose the web tab at top, -> look in the box- if theres some sort of web address with a check in the box next to it- uncheck it! Then hit ok.

It worked for me.

When we have the Load Assembly error my Vendor has updated with CRM Plugin Registration Tool, basically it is a runtime binary (.exe) & this fixed  V3 Callouts to show “Upgraded Callout”.

Below is the complete information for this: ( References: http://code.msdn.microsoft.com – AjithG)

Walkthrough for PluginRegistration tool

Contents

Developer Scenario: 2

Deployment Scenario. 5

Admin Console. 7

Updates. 8

Ver 2.1. 8

Ver 2.2. 9

There are 3 core scenarios that were addressed in this tool.

  1. Developer Scenario: An ISV creates a plug-in and registers it on Contact Create as PreCallout (Aka BeforeMainOperation Plug-in). He can then debug the plug-in by registering on Disk. Once the errors are fixed, he can then update the pluginassembly to be uploaded to the database.
  2. Deployment Scenario: An ISV builds few plug-ins and registers on multiples steps. Images are registered on few of them. He tests them in the Dev environment but would like to port the registrations to a different organization. Pluginregistration tool supports Export and Import of the solution xml to solve this scenario.
  3. Admin Console: Couple of ISV installs their plug-ins on a Customer Organization. Admin at the Customer side saw some problems with “Contact Create” action. He would like to know what plug-in are fired and what the pipeline is for the “Contact – Create”. He then finds the trouble causing plug-in and disables it. So it is all about troubleshooting. PluginRegistration tool solves this problem by allowing Enable/Disable/Unregister operations on steps, plug-in.

Complete feature-set of the tool

  1. Register a pluginassembly, step and image. Validates the data before sending to CRM
  2. Update pluginassembly, step and image
  3. Unregister a pluginassembly shall cascade unregister all the children
  4. Enable, Disable a step
  5. Auto retrieve Custom Entity information from the organization when registering the step
  6. Allows to set more values on step (e.g.: configuration, secureconfiguration, filteringattributes,
  7. Auto retrieve Custom Attributes on entity when registering images
  8. Search the pluginassembly, type, steps, images by names
  9. Visualize the status of the CRM Organization multiple views
    1. View by Assembly : What steps are registered on what plug-in
    2. View by Entity : What steps are registered on an entity(e.g.: contact)
    3. View by Message : What steps are registered on a message (e.g.: create)
  10. Shows the list of Microsoft Dynamics CRM 3.0 callouts registered in the organization
  11. Work with multiple organizations at the same time

Launch the tool by running PluginRegistration.exe. Click on the  button  to create a connection by entering the Discovery service Server Name. Do not prefix the name with http://. Once domain name and user name are entered, Click  to connect  to the deployment. Tool prompts for password. Click  on the Organization Url’s panel on the bottom left corner to connect to the organization.  Each organization you connect to shall show the snapshot of what plug-in are registered in the system.

Developer Scenario:

  1. Click Register in the Organization tab on the right and Click Register New Assembly from the Menu.
  2. Assembly Registration wizard is launched. Select the Assembly to be loaded and select all the plug-in. Screen is self explanatory with all tool tips and inline help. If you select Disk, you are responsible for copying the plug-in assembly to the target CRM server’s <crmroot>\Server\bin\assembly folder.
  3. From the Organization tab menu select Register Step .
  4. Step registration wizard is launched with all the parameters that can be set on the step. This is the critical portion of the registration process.

  1. In CRM 3.0 callout.config.xml is used to specify which action in CRM should fire which callout. This information is stored in SdkMessageProcessingStep entity in CRM 4.0. The Step screen shows all the attributes on that entity and valid values that go with them. Let me demonstrate the scenario with registering a plug-in on “Account – PreUpdate for updated on name of account”.
  2. Message, Primary, Secondary entity text boxes have auto-complete feature turned on with all valid values in the organization.
  3. Type in Update in Message, account in Primary Entity
  4. Click … on the Filtered Attributes and uncheck All and check ‘name’. Click Ok. In this case, only if an account name is updated then the plug-in shall fire.  (Note: Filtered Attributes is needed only for Update Message.)
  5. Select the Plug-in Class that need to be fired when “Account- Create” action happens in CRM
  6. We populate the description but you could change it
  7. Plug-in could be impersonated as any user in CRM. Impersonating user  (Caller or another user) can be specified
  8. If there are multiple plug-in registered on Account-PreUpdate, one can now specify the order in which they need to be executed by setting the Rank / Execution Order. (Integer value).
  9. Select PreStage as it is a PreCallout
  10. Plug-in can be executed as Synchronous or Asynchronous. Only Post operation can be registered as Asynchronous step. (NOTE: CRM does not guarantee the order of execution of the asynchronous step if there are multiple async steps registered on the same event). Select Synchronous in this case
  11. Plug-in can be deployed on Server / Outlook or both. Check Server for this example
  12. Some operations in CRM like Assign of Account, shall update all the tasks of account to another account. If a plug-in was registered on task update, it doesn’t get fired. Since task update is happening as part of another operation, you need to register the step as ‘Child Pipeline’ in order to get it to fire. (This is called InvocationSource property in the SDK). For the current example select Parent Pipeline.
  13. Let’s say you designed a plug-in to connect to http://maps.live.com with some user credentials. It is not a good idea to hard code this information in the plugin. So you need some way to pass this information to plugin and this information like credentials change from one deployment to other. You can achieve this by entering the text in ‘Unsecure Configuration’. If you need to specify any credentials we suggest you do it in ‘Secure Configuration’
    1. i.      UnSecureConfiguration  (Aka Configuration) : Since SdkMessageProcessingStep is OrgOwned any user can read the registration data. So information stored in this field can be accessed by any user of CRM
    2. ii.      SecureConfiguration (SdkMessageProcessingStepSecureConfig): Only System Admins have access to PrvRead on this entity. So information stored in this field is secure by CRM security model. (Note: CRM does not encrypt the data in this field)
  14. Click Register to complete the registration process.
  15. Select Register from the menu  and click to register a Pre and Post image on the step.

  1. Select the step that you want to register the image on
  2. Select the type of the image (Pre / Post / Both)
  3. Give an Alias for the Image so that you can use the same ‘Alias’ to retrieve the image in the Plug-in. (eg: if you enter MyAlias you get it in plugin using  Context.PreEntityImages[“MyAlias”])
  4. Select all the parameters or pick few and click Register image
  5. This completes registering Assembly, Plug-in,  Step and Images

  1. Developer can then register multiple steps by following steps 3-6.
  2. If you select assembly and click Update, it allows updating from Database -> Disk so that one can debug the problems in the plug-in code.

Deployment Scenario

Once the organization has all the steps and plug-in registered, they can be moved to another organization. This tool provides Import/Export Solution Xml feature. All the registration data is exported as an Xml so that it can be imported on any other organization. Following steps shall guide you through the process.

  1. Click ImportExport  and select Export Solution Xml from Organization Menu.

  1. Export Screen is launched

  1. Select the Steps that need to be exported and select the location of the export file and click Export Selected Items.
  2. Click Close
  3. On a different organization. Click  and select Import Solution Xml

  1. Import Solution Xml wizard is launched

  1. Select the file to import
    1. Note: Place all the assemblies (.dll) in the same folder where the .xml is located
    2. Select the Steps to be imported
    3. Click Import Selected
    4. Click Close

Note: Import Export has some limitations and design assumptions

  1. If a plug-in is impersonated on user MyDomain\crmUser and imported in an organization with different domain, it tries to map the user bases on the domain user name (crmuser)
  2. Plug-in assembly DLL’s are not exported in the Xml. When Import is in progress, you need to copy the assemblies to the same location as the .xml file
  3. Import overwrites the assemblies, plug-in, steps, images in the target organization if any other entity exists with same Guid, else it creates them
  4. It is recommended to import assemblies, plug-in, and a step all at once to avoid a lot of overwrites. So delete any existing assemblies with same name on target org. But the tool supports updating or adding a step to the existing plug-in using the import.

Admin Console

CRM deployment Administrator’s would like to monitor the system and need tools to help them understand what is wrong with the system. (For example: on Account Update users are getting errors from plug-in that an ISV installed)

  1. Connect to the CRM server and the Organization
  2. Click views-> Display By Entity

a.All the plug-in / Steps that are registered or acting on each entity is displayed

b.More information about the entity is displayed on the right panel

c.If the admin thinks there is any problem with the step, he can then Disable the step or Enable it back. (Disabled steps have  icon)

d.Admin can also unregister an assembly from the ‘Display By Assembly’ Grid

Updates

- Increased the Crm Connections timeout to infinite time instead of 60 sec.
- Uploaded the Exe so you dont have to rebuild the tool
- Project upgraded to VS 2008

Ver 2.1

  • Works with https:// or SSL based Installs. (SDK calls)
    • I accept all Server Certificates. If you need to change the code look in the CrmConnection.myCertificateValidation implementation
  • Shows the Endpoints returned by the Discovery service before making call to CrmService SDK
    • This allows you to change the endpoint from the client if Discovery service information is not correct for registering plugins. This usually is needed for IFD or for troubleshooting purposes
  • Images for Parent and Subordinate entities for Merge request
    • Now you can register an Image for Subordinate entity also for Merge request. You shall get a pop-up that asks if you need to register for Subordinate or parent
  1. Works on IFD only if logged on the Deployment server using AD auth
  2. Import Solution honors ImageType in the xml
  3. Works with Visual Studio 2008
  4. Restricts registering PreImage for PreCreate

Ver 2.2

  • Support for Scripting for Import /Export operation in the tool
  • PluginDeveloper tool shipped in the SDK has the console application support for scripting but i have got many requests to add support for scripting in the PlguinRegistration tool so that they could use it for deployment purposes.
  • PluginRegistration Tool assumes that you have secure trust established to the CRM server so it doesn’t ask for the credentials. If you do want to run the tool across domains, then you can save the credentials of the CRM server in the Windows->Stored User Names repository and run the application.

Scripting Usage as follows: pluginregistrationtool.exe /? Shows help
/c:<connectionFileName> /cl:<connectionLabel> /org:<organizationName> /op:<operation> /f:<importExportFilename> /n:<ignoreGuids>
Parameter information:

connectionFileName name of the connections file, default: Connections.config
connectionLabel * name of the connection label in the connections config file, Example: newconnection
organizationName name of the working organization, Required in a multi-org deployment, defaults to the single org in a single org deployment
operation * name of the operation, valid entries: import, export
operationFilename * name of file you want to export or import, Example: import.xml
ignoreGuids boolean value (true or false), ignore guids if you are re-importing a group of plugins/workflows
/? Show this help
* denotes required attributes

All the assemblies need to be imported should be in the same folder as the executing exe and so the export.xml file

  • Fixed the OutofMemoryException problem when trying to registering a step on an Imported Organization.
  • Fixed the bug in Image registration wizard (Minimum value cannot be greater than maximum value)
  • Fixed the bug when updating the Impersonation on Step from specified user to “Current User”

** MS-CRM 4.0 Installation Guide**

-> Caller does not have enough privilege to set CallerOriginToken to the specified value

I have installed CRM 4.0 on box where I also installed SQL on the same box and used a domain account as service account. I need to add domain account manually  to the PrivUserGroup else I have received a “Caller does not have enough privilege to set CallerOriginToken to the specified value” error  when trying to access CRM after installation.

Start>run>dsa.msc

1. Opens Active Directory
2. Find your respective OU & PrivUserGroup
3. Open group and add your domain account running your CRM services
4. Reboot CRM server.

Note: 1) Tried without server reboot didn’t worked. So its compulsory to reboot the server.

2) I don’t have this issue when I  used SQL on different box.

Show Desktop icon

1) Right-click on your Taskbar and select:
2) Toolbars > Quick Launch

The “Show Desktop” icon will appear on the left
side of the Taskbar.

Follow

Get every new post delivered to your Inbox.