Microsoft Knowledge Base Email Alertz

(933451) - Describes a problem that occurs if you create more than two custom entities before you install the Microsoft Dynamics CRM Connector. A workaround is provided.

Search KbAlertz

Advanced Search

Receive Microsoft Knowledge Base articles by E-Mail?

Every night we scan the Microsoft Knowledge Base. If technologies you're interested in are updated, we'll send you an e-mail. You only get one e-mail a day, and only when new articles are added.

Click here to create a
FREE account
Already have an account?
[Click here to Login]











Microsoft Knowledge Base Article

This article contents is Microsoft Copyrighted material.
©2005-©2007 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks

Article ID: 933451 - Last Review: August 21, 2007 - Revision: 1.2

Error message when you click the lookup button next to the "Great Plains Site" field in the Order Product form in Microsoft Dynamics CRM 3.0

On This Page

SYMPTOMS

Consider the following scenario in Microsoft Dynamics CRM 3.0:
  • You create a sales order.
  • Then, you create an order product for the sales order.
  • Finally, you click the lookup button next to the Great Plains Site field in the Order Product form.
In this scenario, you receive one of the following error messages.

If the DevErrors value is set to On in the Web.config file, you receive the following error message:
Server Error in '/' Application. The entity with ObjectTypeCode = 10001 was not found in the MetadataCache.
If the DevErrors value is set to Off in the Web.config file, you receive the following error message:
Query Builder Error No Entity.
This problem occurs if the following conditions are true:
  • The Microsoft Dynamics CRM Connector for Microsoft Dynamics GP is installed.
  • You create more than two custom entities before you install the Microsoft Dynamics CRM Connector.

CAUSE

This problem occurs because the Microsoft Dynamics CRM Connector for Microsoft Dynamics GP Setup program assumes that no custom entities exist in Microsoft Dynamics CRM.

The Setup program installs the New_BOOrderType custom entity and the New_BOProductSite custom entity. Then, the Setup program assigns ObjectTypeCode 10000 to the New_BOOrderType custom entity. The Setup program assigns ObjectTypeCode 10001 to the New_BOProductSite custom entity.

Microsoft Dynamics CRM uses ObjectTypeCode 10001 for the New_BOProductSite custom entity when you click the lookup button next to the Great Plains Site field. If you have created more than two custom entities before you install the Microsoft Dynamics CRM Connector, these ObjectTypeCode values may be incorrect.

WORKAROUND

For more information about this workaround, contact Microsoft Customer Support Services. For a complete list of Microsoft Customer Support Services telephone numbers, and for information about support costs, visit the following Microsoft Web site:
http://support.microsoft.com/contactus/?ws=support (http://support.microsoft.com/contactus/?ws=support)
Note In special cases, charges that are ordinarily incurred for support calls may be canceled if a Microsoft Support Professional determines that a specific update will resolve the problem. The usual support costs will apply to additional support questions. The usual support costs will apply to issues that do not qualify for the specific update in question.

To work around this problem, change the ObjectTypeCode value for the New_BOProductSite custom entity to a correct ObjectTypeCode value.

Note Before you follow the instructions in this article, make sure that you have a complete backup copy of the database that you can restore if a problem occurs.

To do this, follow these steps:
  1. Make sure that you have complete backup copies of the following databases:
    • The OrganizationName_MSCRM database
    • The OrganizationName_METABASE database
    For more information about how to back up the databases, view "Chapter 26: Backing Up Your Microsoft CRM System" in the Microsoft CRM 3.0 Implementation Guide. To obtain the Microsoft CRM 3.0 Implementation Guide, visit the following Microsoft Web site:
    http://www.microsoft.com/downloads/details.aspx?FamilyID=1ff067f8-4f77-40f0-ae9c-68ada7d4f16a&DisplayLang=en (http://www.microsoft.com/downloads/details.aspx?FamilyID=1ff067f8-4f77-40f0-ae9c-68ada7d4f16a&DisplayLang=en)
  2. Determine what ObjectTypeCode value is associated with the New_BOProductSite custom entity. To do this, run the following script against the OrganizationName_METABASE database.

    Note Run this script by using SQL Query Analyzer or by using SQL Server Management Studio.
    USE <OrganizationName>_METABASE 
    GO
    SELECT Name,PhysicalName,LogicalName, ObjectTypeCode 
    FROM Entity
    WHERE ObjectTypeCode >= 10000
    AND Name = 'New_BOProductSite'
    ORDER BY ObjectTypeCode
    Note In this script, <OrganizationName> is a placeholder that represents the actual organization name.
  3. If the ObjectTypeCode value for the New_BOProductSite custom entity is not equal to 10001, note the ObjectTypeCode value that is returned after you run the query.
  4. Log on to the Microsoft Dynamics CRM 3.0 Web site as a user who has the Microsoft Dynamics CRM administrator role.
  5. Click Settings, click Customizations, and then click Export Customizations.
  6. Click Export All Customizations, and then save the file as the All_MSCRM_Customizations.xml file.

    Note This step is used to back up all custom attributes and all custom entities.
  7. Click an entity whose schema name is salesorderdetail.

    Note By default, the Order Product entity has this schema name. However, the entity can be renamed.
  8. On the More Actions menu, click Export Selected Customizations.
  9. Click OK, and then save the file as the SalesOrderDetail_Original.xml file.
  10. Make a copy of the SalesOrderDetail_Original.xml file, and then rename the copied file as SalesOrderDetail_Fixed.xml.
  11. Use WordPad to open the SalesOrderDetail_Fixed.xml file.
  12. In WordPad, click Replace on the Edit menu.
  13. In the Replace dialog box, type 10001 in the Find what field, type the ObjectTypeCode value that you noted in step 3 in the Replace with field, and then click Replace All.
  14. Save the SalesOrderDetail_Fixed.xml file.

    Note Make sure that the file type is Text Document.
  15. Click Settings, click Customizations, and then click Import Customizations.
  16. Click Browse next to the Import File field, click the SalesOrderDetail_Fixed.xml file, and then click Open.
  17. Click Upload. The Order Product entity appears in the Import Customizations form.
  18. Click Import All Customizations.
  19. After the Order Product entity customization is imported, click OK.
  20. Click Customization, and then click Customize Entities.
  21. On the More Actions menu, click Publish All Customizations.
  22. Click Start, click Run, type iisreset, and then click OK.
  23. Delete temporary Internet files. To do this, follow these steps:
    1. Start Internet Explorer.
    2. Click Tools, and then click Internet Options.
    3. Use one of the following methods, depending on which version of Internet Explorer you are using:
      • In Windows Internet Explorer 7, click Delete in the Browsing history area, click Delete files in the Temporary Internet Files area, and then click Yes.
      • In Microsoft Internet Explorer 6, click Delete Files in the Temporary Internet files area, and then click OK.
    Note To correctly use the Great Plains Site field, you must create a Great Plains site, and you must associate the Great Plains site with the item that is integrated as the Microsoft Dynamics CRM 3.0 product.

STATUS

Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.

MORE INFORMATION

Steps to reproduce the problem

  1. Create more than two custom entities.
  2. Install the Microsoft Dynamics CRM Connector.
  3. On the New menu, click Order.
  4. In the Name field, type an order name.
  5. Click the lookup button next to the Customer field, click a customer, and then click OK.
  6. Click the lookup button next to the Price List field, click a price list, and then click OK.
  7. Click Save.
  8. Click Existing Products, and then click New Order Product.
  9. Click the lookup button next to the Product field, click a product, and then click OK.
  10. Click the lookup button next to the Unit field, click a unit, and then click OK.
  11. Click the lookup button next to the Great Plains Site field.
The following code is part of an example of the SalesOrderDetail_Fixed.xml file.
<ImportExportXml version="3.0.5300.0">
  <Entities>
    <Entity>
      <Name LocalizedName="Order Product" OriginalName="Order Product">SalesOrderDetail</Name>
      <ObjectTypeCode>1089</ObjectTypeCode>
      <LocalizedName>Order Product</LocalizedName>
      <LocalizedCollectionName>Order Products</LocalizedCollectionName>
…
var aSiteLookups=window.document.forms['crmForm'].elements['productid'].DataValue;
	if(aSiteLookups && aSiteLookups.length > 0)
	{ 
		if(IsOutlookLaptopClient())
			{
				var lookupItem = openStdDlg("/_controls/lookup/lookupsingle.aspx?class=null&objecttypes=10005&browse=0&DefaultType=0",null,"600px","488px",true,null,null);
				if(lookupItem && lookupItem.items.length > 0)
					{
						var lookupfield = crmForm.new_boproductsiteid.parentElement.parentElement.firstChild.firstChild;
						var lookup = event.srcElement;
						lookup.Clear();
						lookup.AddItems(lookupItem.items);
					}
													
													
	        }
		else
			{
				var productid = aSiteLookups[0].id;
				var url = '\\Integration\\LookupSite.aspx?productid='+productid+'&objecttypes=10005';											
				var lookupItem=window.showModalDialog(url);
				if(lookupItem && lookupItem.items.length > 0)
					{
						var lookupfield = crmForm.new_boproductsiteid.parentElement.parentElement.firstChild.firstChild;
						var lookup = event.srcElement;
						lookup.Clear();
						lookup.AddItems(lookupItem.items);
						//				BuildField(lookupfield, lookupItem); 
					}
													
			}
	}
…

REFERENCES

For more information about how to set the DevErrors value, click the following article number to view the article in the Microsoft Knowledge Base:
857192  (http://kbalertz.com/Feedback.aspx?kbNumber=857192/ ) How to modify the Web.config file to show more detailed error messages in Microsoft CRM
For more information, click the following article number to view the article in the Microsoft Knowledge Base:
927667  (http://kbalertz.com/Feedback.aspx?kbNumber=927667/ ) The Import Customizations Web page does not close as expected when you try to import customizations in Microsoft Dynamics CRM 3.0 after you install Internet Explorer 7
For more information, click the following article number to view the article in the Microsoft Knowledge Base:
918990  (http://kbalertz.com/Feedback.aspx?kbNumber=918990/ ) You experience timeouts or slow performance after you change a security role or after you import a customization file in Microsoft Dynamics CRM 3.0

APPLIES TO
  • Microsoft Dynamics CRM 3.0
  • Microsoft Dynamics CRM Connector for Microsoft Dynamics GP, when used with:
    • Microsoft Dynamics CRM 3.0
Keywords: 
kberrmsg kbtshoot kbbug kbmbsmigrate kbmbscustomization KB933451
       

Community Feedback System

Very often, it takes hours to solve a problem. Very often, you've looked high and low, and have tried a lot of solutions. When you finally found it, chances are, it was because someone else helped you. Here's your chance to give back. Use our community feedback tool to let others know what worked for you and what didn't.

Please also understand that the community feedback system is not warranted to be correct, it's simply a system that we've built to let people try and help each other. If something in a feedback response doesn't make sense to you, or you're not comfortable making changes that the feedback talks about (like registry edits), please consult a professional.

Thank you for using kbAlertz.com Feedback System.

-- Scott Cate