title: The entity with name <entityName> was not found in the MetadataCache
body: <p>Following a Microsoft hands-on lab for Dynamics CRM 2011, I am attempting to add a custom view  to a form that responds 'onchange' to a particular property. Here is my function to add the custom view:</p>
  
  <pre><code>function HandleOnChangeDVMInformationLookup()
  {
  var locAttr = Xrm.Page.data.entity.attributes.get("new_referringdvm");
  
  if (locAttr.getValue() != null)
  {
      var dvmId = locAttr.getValue()[0].id;
  
      var viewDisplayName = "DVM Information";
      var viewIsDefault = true;
  
      var fetchXml  = '&lt;fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false"&gt;&lt;entity name="dvminformation"&gt;&lt;attribute name="dvminformation_id"/&gt;&lt;attribute name="dvminformation_name"/&gt;&lt;attribute name="new_firstname"/&gt;&lt;attribute name="new_lastname"/&gt;&lt;filter type="and"&gt;&lt;condition attribute="id" operator="eq"  value="' +dvmId +'"/&gt;&lt;/filter&gt;&lt;/entity&gt;&lt;/fetch&gt;';
  
      var layoutXml = '&lt;grid name="resultset" object="10001" jump="dvminformation_name" select="1" icon="1" preview="1"&gt;&lt;row name="result" id="dvminformation_id"&gt;&lt;cell name="dvminformation_name" width="300" /&gt;&lt;cell name="new_firstname" width="125"/&gt;&lt;/row&gt;&lt;/grid&gt;';
  
      var control = Xrm.Page.ui.controls.get("new_dvm_information");
      control.addCustomView("62e0ee43-ad05-407e-9b0b-bf1f821c710e", "dvminformation", viewDisplayName, fetchXml, layoutXml, viewIsDefault );
  }
  }
  </code></pre>
  
  <p>Upon changing the selected 'dvm' in the form and triggering this function I receive the following error:</p>
  
  <blockquote>
    <p>Unhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: The entity with a name = 'dvminformation' was not found in the MetadataCache.Detail: 
    
      -2147217150
      
      The entity with a name = 'dvminformation' was not found in the MetadataCache.
      2013-06-10T22:01:49.4392114Z
      
      
    </p>
  </blockquote>
  
  <p>Is 'dvminformation' not the entity name I just defined in the XML? Am I missing a step?</p>
  
  <p>Thanks.</p>