Wes Weeks

  Home  |   Contact  |   Syndication    |   Login
  21 Posts | 1 Stories | 109 Comments | 3 Trackbacks

News

Archives

Post Categories

While performing an update to some code originally written for CRM 3.0 which I was upgrading to 4.0 and using the new 2007 version of the web services, I found myself getting an unusual error during one of the callouts.  The code created a new custom entity from the data in an existing entity.  This code was orginally written by another party and I"m not sure why they didn't use the mapping features in CRM to do this but it was coded manually.

The entity with typecode '8' was not found in the Metadata Cache.

Never having seen this before it of course took a lot of time digging through the event viewer and trace logs to find the source of the error.  In this case, it came down to one line:

newEntity.OwnerId = originalEntity.OwnerId

In a nutshell: the 'type' attribute on the originalEntity which had just been read out of CRM using the web services was '8', however when creating/setting the type on create the attribute field needs to be the name of the entity.  In this case, since the owner was a system user, the type field needed to be set to 'systemuser'

One would think that the inbound and outbound values could be the same or possible set up to parse for both a type code of or the type name.....

Anyway, if someone else comes across this or a similar problem, I hope this helps.

  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati
posted on Sunday, September 07, 2008 7:12 AM

Feedback

# re: Entity Typecode not found in Metadata Cache 7/20/2009 7:17 AM Nand
thanks a lot.

It was of great help

# re: Entity Typecode not found in Metadata Cache 3/2/2010 5:00 AM sTEVE
great post. saved me a lot of time and headache

# re: Entity Typecode not found in Metadata Cache 6/24/2010 12:11 PM sean r
that has just save me a nervous breakdown. thankyou!

# re: Entity Typecode not found in Metadata Cache 7/4/2010 3:03 AM RFish
Was ready to kill someone - thanks!!! :-)

# re: Entity Typecode not found in Metadata Cache 8/4/2010 7:40 AM coloured contact lenses
When ever your upgrading, you pretty much always find some sort of issue that has to be fixed manualy

Post A Comment
Title:
Name:
Email:
Website:
Comment:
Verification: