Saturday, January 31, 2009

Error message when you start Microsoft Dynamics CRM 4.0: "An error occurred loading Microsoft Dynamics CRM functionality"

SYMPTOMS
When you run one of the Microsoft Dynamics CRM programs that are listed in the "Applies to" section, you receive the following error message: 
 "An error occurred loading Microsoft Dynamics CRM functionality. Try restarting Microsoft Outlook. Contact your system administrator if errors persist."

Additionally, you receive error messages that resemble the following error messages:

In the Microsoft.Crm.Application.Hoster log file: 
>MSCRM Error Report:
------------------------------------------------------------------------ 
Error: Server was unable to process request. 
Error Number: 0x80040220 
Error Msg: SecLib::CrmCheckPrivilege failed. Returned hr = -2147220960 on UserId: 5ba13d12-846b-dc11-beb1-00188b44dd1f and PrivilegeId: 588725dd-c878-41c5-a4c3-5efc93cd3ffd 
Source File: Not available 
Line Number: Not available

In the Application log: 
Event Type: Error 
Event Source: MSCRMAddin 
Event Category: None 
Event ID: 5903 
Date: date
Time: time
User: N/A 
Computer: computer_name
Description: The Microsoft CRM Outlook add-in could not be initialized correctly. Restart Microsoft Outlook and try again. HR=0x80070057. Context=. Function=CAddin::OnConnection. Line=196. 

For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp. 
Event Type: Error 
Event Source: MSCRMAddin 
Event Category: None 
Event ID: 16930 
Date: date
Time: time
User: N/A 
Computer: computer_name
Description: Initialization of the Microsoft CRM UI failed. Try restarting Microsoft Outlook. HR=0x80004005. Context=. Function=CAddin::HrActivateAddin. Line=665. 

For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp. 
Event Type: Error 
Event Source: MSCRMAddin 
Event Category: None 
Event ID: 5907 
Date: date
Time: time
User: N/A 
Computer: computer_name
Description: Microsoft CRM custom folders could not be loaded into Microsoft Outlook. Restart Microsoft Outlook and try again. HR=0x80004005. Context=. Function=CAddin::HrInitializeUI. Line=132. 

For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp. 
Event Type: Error 
Event Source: MSCRMAddin 
Event Category: None 
Event ID: 5942 
Date: date
Time: time
User: N/A 
Computer: computer_name
Description: Microsoft CRM could not add a folder to Microsoft Outlook. Restart Microsoft CRM and try again. Microsoft CRM may need to be repaired or reinstalled. HR=0x80020009. Context=. Function=CFolderModifier::InsertNode. Line=152.

CAUSE
This problem may occur when a custom entity and a site map entry have the same name.

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

Method 1

Change the plural name of the custom entity. To do this, follow these steps:
  1. Start Microsoft Dynamics CRM.
  2. In the navigation pane, click Settings, click Customization, and then click Customize Entities
  3. Double-click the entity that has the same name as a site map entry.
  4. In the Plural Name box, type a new name that you want to use for the entity.
  5. Click Actions, click Publish, and then click Save and Close.
  6. Restart Microsoft Dynamics CRM.
Method 2

Change the title in the site map to a name that differs from the name of the custom entity. To do this, follow these steps:

  1. Start Microsoft Dynamics CRM.
  2. In the navigation pane, click Settings, click Customization, and then click Export Customizations.
  3. In the Export Customizations list, click Site Map, click Export Selected Customizations, and then click OK.
  4. Click Save. When you are prompted, save the file to a location on the computer, and then click Save.
  5. Extract the Customizations.xml file, and then open the .xml file in Notepad. The Customizations.xml file is saved in a .compressed file that has a .zip file name extension in the location that you specified in step 4.
  6. On the Edit menu, click Find. Search for the name that is the same as the custom entity, and then change the name so that it differs from the name of the custom entity.
  7. On the File menu, click Save, and then exit Notepad.
  8. In the navigation pane, click Settings, click Customization, and then click Import Customizations.
  9. Click Browse, locate and then select the file that you edited in step 6, and then click Open.
  10. Click Upload, and then click Import Selected Customizations.
  11. Restart Microsoft Dynamics CRM.

Two default views in CRM

Two default views? How to get back to one

You might come across a scenario where you see that Microsoft CRM lists two different views as the "default" for an entity (as shown in the screenshot below):



Obviously this is not the intended behavior as only one view should be listed the default. Changing the default view and re-publishing the entity with the web interface does not appear to correct this issue. While we're not 100% what causes this scenario, we have figured out a method to fix it.

First you need to export the customizations.xml file for the entity. Then open the customizations file and search for the duplicated defaulted view and change the
 
"isdefault name="Yes" "1 "isdefault "
To
"isdefault name="No" "0 "isdefault"

Note that when you find the view "name" in the customizations.xml file, it is actually at the bottom of the node. This means you will need to scroll up in the file to find the "isdefault" node.

Save, import, publish and you should be all set again.


Enable passing params in crm 4 query string

Sometimes in Dynamics CRM 4.0 we need to transform parameters as part of the QueryString (the URL).
In Dynamics CRM 3.0 we didn't have a problem to that, but in Dynamics CRM 4.0 you must follow the next steps:

1. Go to Registry into [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSCRM]
2. Create a new DWORD with the name of [DisableParameterFilter]
3. Give [DisableParameterFilter] the value 1
4. iisreset

Enjoy.

Error while Assign account to user

I had the following problem after upgrade CRM 3 to CRM 4:

Problem: general unexpected error while assigning account to user or to myself:


Solution: KB 948172  Error message when you delete a queue item from a queue in Microsoft Dynamics CRM 4.0: "Record is unavailable"

http://support.microsoft.com/default.aspx?scid=kb;EN-US;948172


Track in CRM failed due to text exceeds maximum length

Problem: Error message while track email in CRM: the text entered exceeds the maximum length.

Solution: Go to customization, email, attributes, on messageID attribute change the length for more then 100 (I changed to 256).


Setting that must be changed at your Home CRM Outlook Client

This few step will allow you to work with the CRM Outlook Client Out of office.
There are several Settings that must be checked and changed before you install the CRM Outlook Client. 
Follow the next Steps:

1) In the Address of CRM server DON'T Write http://crm as it is in your office, Instead write the FULL path to the CRM for Example : http://crm.ABC.co.il

2) Place the the URL : http://crm.ABC.co.il that we have just spoke about to "Trusted Sites" in the Computer you'r installing the CRM Outlook Client. in order to do so follow the next steps :

A) Open Internet Explorer

B) Go to Tools Choose Internet Options

C) Go to Security Tab, Choose Trasted Sites and then Press the SITES Button



D) Place the Address *.ABC.co.il to the Websites list, and uncheck the check button



E) Press the Custom Level Button to get into the Advanced Policy of Trasted Sites Scroll till the end of the list mark the "Automatic logon with the current user name and password" then press OK. if you get an alert that wants you to confirm the change, Press YES to confirm it.



F) Press OK to Confirm the changes that were made and to close the window.

G) On the Internet Explorer go to the server with your address : http://CRM.ABC.co.il

H) In the authentication popup window your name : DOMAIN\USER
and the Password you use in your office. Check the Save password checkbox then Prees OK

I) Now you can close the CRM window, your password is saved in the system

J) If you have Installed The CRM Outlook Client Before you have made those changes remove the CRM Outlook Client and reinstall it.

Now The CRM Outlook Client Suppose to Work Just Fine.

Changing CRM tab color

In order to Change the Color of the Tab On the OnLoad or OnChange add the following Script:

crmForm.all.tab3Tab.style.backgroundColor="blue";

Cannot add product using crm webservice - Error Number: 0x80043B0A

While trying to add a new product through a webform, I get the following error:



Error Number: 0x80043B0A

To resolve this problem you should check that both "Unit" and "Default Unit" are Business Required fields.

try to place values into both of them and you will find out that the error is no longer exist.

A schema validation error has been detected

Recently i have recieved the following error :

A schema validation error has been detected at line 54409, position 16.

This error shows up if you want to import a customizations file which has been exported from a system which has the Update Rollup package 1 installed.

VisibleToPlatform 0 /VisibleToPlatform

VisibleToPlatform 1 /VisibleToPlatform

There may be multiple reasons for this error to show up, but at least one of them is the existence of one of these lines in your code:

To solve the error message, just remove the line from the code or install the rollup package 1. For information and download of the package go here: http://support.microsoft.com/default.aspx/kb/922815

Error 0x80042F09 while trying to change owner

Scenario 
When you are trying to assign diferent owner you get the following error: 0x80042F09




Cause 
The user, you are assigning has no ROLES asigned.

Solution 
Add relevant ROLE to user

Enabling and Editing ISV.CONFIG

To edit the isv.config, do the following:

1.Export the isv.config using the Export Customizations tool. 

2.Create a backup copy of the exported XML file. Use this file to recover from errors.

3.Make your changes to the exported XML file.

4.Import the updated XML file using the Import Customization tool.

This file contains examples of the various customizations you can perform. You should rename this file and then create your own configuration file. By doing this you will not confuse the sample UI changes with the UI changes you need for your customization.

Enabling your customizations
To enable your customizations, modify the ISVIntegration setting in the web.config file, which is located at:

\wwwroot\web.config

This setting appears as follows:

The ISVIntegration setting is used as a performance optimization. When there are no customizations to be rendered, the value for this setting should be None. Multiple values can be used as long as they are separated by a comma and do not contain spaces, as shown in the following examples: 

The following table shows the possible values for the ISVIntegration setting.

Value Description 
All - Integration is turned on for both Outlook and Web clients 
None - Integration is not turned on 
Outlook - Integration is turned on for only the Outlook client 
OutlookWorkstationClient - Integration is turned on for only the full Outlook client 
OutlookLaptopClient - Integration is turned on for only the light Outlook client 
Web - Integration is turned on for only the Web client 

ISV Extensions Privileges
After you have enabled your customizations, you need to set the ISV Extensions privilege for security roles that need to use the customizations. By default, the security roles that do not represent a management position do not have ISV Extensions Privilege.

Disabling your customizations
To disable your customizations for either client you must use the appropriate setting in the web.config file. 

Security Issues

Any integration into the application or the Outlook client must participate in security. That is, any server or client application calling into the Microsoft CRM 3.0 application programming interface (API) must have user context in the same domain.

Group Policy to control preferences on the CRM Outlook Client

How to standardize synchronization settings for the CRM Outlook clients.

Attached is a basic template that allows an administrator to standardize the registry settings that affect how the CRM client for Outlook behaves on a client computer. 

CRM client for Outlook is not really Group Policy compliant because the registry settings it uses do not exist in the proper area of the registry. The attached template is actually applying "old style" NT preferences as opposed to policy. The major difference is that when a true group policy is removed, the registry settings on the affected machines are also removed. When an "old style" policy like this one is removed the registry settings on the target machines are not changed. So a word of caution here, any changes you make using this template will permanently overwrite registry settings on the target computer. Take a moment to understand what the current settings are on your systems before implementing this template.

To use this template unzip the file and then copy the MSCRMClient30.adm file to the C:\Windows\inf folder on the machine you are using to manage group policy. Open GPMC and create a new policy linked to an OU. Edit the new policy and then add the new template as follows:

• Right click the Administrative Templates folder under the User Configuration and select Add/Remove Templates. 
• Click the Add button and then locate the MSCRMClient30.adm policy file and click OK to save. 
• Click Close on the Add/Remove template to finish adding the template to the policy. 
• Make sure the Administrative Template folder is still selected and then select the View -> Filtering option from the MMC menu bar. 
• Uncheck the "Only show policy settings that can be fully managed" check box and click OK. (You will need to do this each time you want to edit the policy.)

You will now see a folder under Administrative Templates named Microsoft Dynamics CRM 3.0 Client for Microsoft Outlook with various policies in sub folders.

Improving the Outlook Client User Experience

Sometimes a Microsoft Dynamics CRM 3.0 Laptop Client for Outlook (hereafter referred to as the CRM Outlook Laptop Client) user can experience a hang or bad performance when using the tracking functionality. In this case just setting 'Regarding' field information for an email to be tracked in CRM or viewing regarding information for an email that is tracked in CRM causes the Server to not respond. If you've run into this problem read on.

What is the Cassini Hoster Process? 
The Cassini Hoster process is a substitute for IIS on the CRM Outlook Laptop Client that handles all the Web page processing on the client.

Why does this happen? To keep the ASP.Net running, which improves performance, the Cassini Hoster Process sends heartbeat pings based on the time set in registry key CassiniPollingPeriod.

The ApplicationHost.CreateApplicationHost is used to create an application domain to host ASP.Net. Every time the Cassin Polling period (milliseconds) expires we re-issue a heartbeat ping to the homepage.aspx to keep the ASP.NET running. This heartbeat ping is issued using the BeginGetResponse asynchronously. The problem is, we do not call “EndGetResponse” for the response got from the Server in the Response callback function. This causes, Cassini Server thread to just be held up in a wait state waiting for the client to invoke “EndGetResponse”.

As time passes, the heartbeat pings are accumulated and can depending on the machine configuration and settings exhaust all the worker threads. The server uses up all the threads and reaches a state where it no longer has any more threads to process genuine client requests coming from the CRM Outlook Laptop client. The user can then experience a hang or maybe reduced performance.

Okay, how do I fix this? 
The hunt to identify the locking up of threads waiting on client’s invocation of “EndGetResponse” was the most difficult part of figuring this out. Once this was identified, the fix was very simple. This is where KB 938574 comes into picture and this hotfix resolves the problem by calling the EndGetResponse in the Response callback function.

You can download the fix to resolve the Cassini hang issue from the link below:
http://support.microsoft.com/default.aspx?scid=kb;EN-US;938547

Thank and enjoy.

Changing the Link of a Ticker Symbol from MSN Money to Google Finances

This is unsupported solution to change the ticker symbol to Google finance:

On C:\Inetpub\wwwroot\_forms\controls (may vary depending on your installation)
Open the following file: INPUT.text.ticker.htc

Change the line: 

safeWindowOpen("http://go.microsoft.com/fwlink?linkid=8506&clcid=" + CrmEncodeDecode.CrmUrlEncode(USER_LANGUAGE_CODE) + "&Symbol=" + CrmEncodeDecode.CrmUrlEncode(value), "", "height=" + (screen.availHeight * .75) + ",width=" + (screen.availWidth * .75) + ",scrollbars=1,resizable=1,status=1,toolbar=1,menubar=1,location=1");

Replace with: 

safeWindowOpen("http://finance.google.com/finance?q=" + CrmEncodeDecode.CrmUrlEncode(value), "", "height=" + (screen.availHeight * .75) + ",width=" + (screen.availWidth * .75) + ",scrollbars=1,resizable=1,status=1,toolbar=1,menubar=1,location=1");

Enjoy.

Thursday, January 29, 2009

How to modify the Web.config file to show more detailed error messages in Microsoft CRM

This article describes how to modify the web.config file to show more detailed error messages in Microsoft Dynamics CRM 3.0, in Microsoft CRM 1.2, and in Microsoft Business Solutions CRM 1.0.

MORE INFORMATION

You can receive more detailed (debug) error messages in one or more of the following products:

• The Microsoft CRM Web client
• The Microsoft CRM 1.2 Sales for Outlook client (the Outlook client)
• The Microsoft CRM client for Microsoft Office Outlook

You can modify either or both of the Web.config files that are in the Microsoft CRM deployment. We do not recommend that you use debug error messages in production environments. However, you may find these messages useful when you try to debug a problem that occurs in Microsoft CRM.

To modify the Web.config file, follow these steps:
1. In Windows Explorer, locate the Web.config file.
• If you are receiving errors in the Microsoft CRM Web client, modify the Web.config file that is located on the Microsoft CRM server. By default, this file is located in the following folder::\inetpub\wwwroot
• If you are receiving errors in the Microsoft CRM 1.2 Sales for Outlook client, modify the Web.config file that is located on the client computer. By default, this file is located in the following folder::\Program Files\Microsoft CRM\Client\res\Web

Note This option is unavailable in the Microsoft CRM 1.0 Sales for Outlook client.
• If you are receiving errors in the Microsoft CRM desktop client for Microsoft Office Outlook, modify the Web.config file that is located on the Microsoft CRM server. By default, this file is located in the following folder::\inetpub\wwwroot
• If you are receiving errors in the Microsoft CRM laptop client for Microsoft Office Outlook, modify the Web.config file that is located on the client computer. By default, this file is located in the following folder::\Program Files\Microsoft CRM Client\res\Web

2. Open the file by using Notepad or another text editing program.
3. In the file, scroll down the text toward the end of the file to find the following statement: By default, this value is set to Off. Modify this line to read as follows:Then, save the file.
4. After you modify the Web.config file on the Microsoft CRM server, close the error window, and then retry the same action that resulted in the previous error message. You should receive a more detailed (debug) error message.
5. After you use the detailed (debug) error message to troubleshoot, repeat steps 1 through 4 to change the value of the statement back to the default setting of Off. The statement now reads as follows:
6. Save the file.

How to change Field Requirement Level

This script allows you to change the requirement level for one or more fields.

The number in the script means the following :
0 - No Constraint
1 - Business Recommended
2 - Business Required

crmForm.SetFieldReqLevel("AttributeSchemaName", 1);

CRM Bug - CRM prompting to save or download blank.aspx

Recently we've started receiving the following message from the CRM.



Description:

Name: Blank.aspx

Type: Uknown File Type
From:

There are 2 possible ways to overcome this issue:

1) Remove the fix KB953838
2) Reasosiation :
2.1) Save the file on the computer
2.2) Open it
2.3) The application will ask, how do you want to open it, choose "Internet Explorer" and mark "Always Use"

Enjoy.

Form Assistant for Dynamics CRM 4.0 / 3.0

Purpose :
1) Some clients don't like using Form Assistant
2) On low resolution screens, I don't recommend using Form assistant. It takes up too much space

There are several steps we need to follow in order to hide the form assistant.

Dynamics CRM 3.0 – How to hide?
1. Export related Entity (where you want to disable Form Assistant)
2. Find the following: relatedInformationCollapsed="true";
3. Change "true" to "false"
4. Import

Dynamics CRM 4.0 – How to hide?
1. Go to customizations à Enter the relevant entity
2. Go to forms and views à Enter “Form”
3. Click on “Form Properties” and go to “Display” tab
4. Turn On/Off the features according to your needs

5. Click “Ok”
6. Save and close the form
7. Publish the entity and that’s it :)