javascript-在MetadataCache中找不到具有名称的实体
作者:互联网
在Microsoft Dynamics CRM 2011的动手实验之后,我试图将自定义视图添加到对特定属性进行“ onchange”响应的表单中.这是我添加自定义视图的功能:
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 = '<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false"><entity name="dvminformation"><attribute name="dvminformation_id"/><attribute name="dvminformation_name"/><attribute name="new_firstname"/><attribute name="new_lastname"/><filter type="and"><condition attribute="id" operator="eq" value="' +dvmId +'"/></filter></entity></fetch>';
var layoutXml = '<grid name="resultset" object="10001" jump="dvminformation_name" select="1" icon="1" preview="1"><row name="result" id="dvminformation_id"><cell name="dvminformation_name" width="300" /><cell name="new_firstname" width="125"/></row></grid>';
var control = Xrm.Page.ui.controls.get("new_dvm_information");
control.addCustomView("62e0ee43-ad05-407e-9b0b-bf1f821c710e", "dvminformation", viewDisplayName, fetchXml, layoutXml, viewIsDefault );
}
}
在更改表单中选定的“ dvm”并触发此功能后,我收到以下错误:
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
“ dvminformation”不是我刚刚在XML中定义的实体名称吗?我错过了一步吗?
谢谢.
解决方法:
dvminformation不太可能是真实的实体名称.您确定存在一个使用该名称的实体吗?
打开解决方案并查找实体,然后检查其架构名称.
如果是自定义实体,则通常具有prefix_name的格式,例如new_timeline,new_alert,在您的情况下,可能只是dvm_information.如果dvm是您的解决方案前缀.
只有系统实体的名称没有下划线,例如在我看来,联系方式,帐户,事件和dvminformation看起来并不像系统实体.
标签:dynamics-crm,dynamics-crm-2011,javascript 来源: https://codeday.me/bug/20191030/1970612.html