Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/450.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用Javascript创建自定义查找_Javascript_Dynamics Crm 2011_Crm - Fatal编程技术网

使用Javascript创建自定义查找

使用Javascript创建自定义查找,javascript,dynamics-crm-2011,crm,Javascript,Dynamics Crm 2011,Crm,这段代码在4.0中运行,2011年,当我试图设置查找值时,我得到一个“initializelookuppresence”错误 4.0代码 lookupCell.innerHTML = '<TABLE style="table-layout: fixed" class="ms-crm-Lookup" cellspacing="0" cellpadding="0" width="100%"><TBODY><TR><TD><DIV class="m

这段代码在4.0中运行,2011年,当我试图设置查找值时,我得到一个“initializelookuppresence”错误

4.0代码

lookupCell.innerHTML = '<TABLE style="table-layout: fixed" class="ms-crm-Lookup" cellspacing="0" cellpadding="0" width="100%"><TBODY><TR><TD><DIV class="ms-crm-Lookup" tabindex="1011" role="list" ime-mode="auto" ms-crm-hidden-nobehavior><UL style="float: left"></UL></DIV><LABEL class="ms-crm-Hidden-NoBehavior" for=' + id + '_ledit>Related Entity</LABEL><INPUT style="display: inline"  id='+ id +'_ledit class=ms-crm-Hidden-NoBehavior disabled tabIndex=1010 ime-mode="auto"></TD><TD class=Lookup_RenderButton_td width=25><IMG style="ime-mode: auto" id=' + id + ' class="ms-crm-Lookup ms-crm-ImageStrip-btn_off_lookup" title="Click to select a value for Company." alt="Click to select a value for Company." src="/_imgs/imagestrips/transparent_spacer.gif" savedquerytype="" forfield=' + label + ' isDisplayOnly="False"  resolveemailaddress="0" disableviewpicker="0" disablequickfind="0" disablemru="0" allowfilteroff="1" AutoResolve="1" additionalparams=""  defaulttype="2" lookupstyle="single" lookupbrowse="0" lookuptypeIcons="/_imgs/ico_16_2.gif:/_imgs/ico_16_8.gif" lookuptypenames="contact:2:Contact,systemuser:8:User" lookuptypes="2,8" attrpriv="7"  req="1" _lookupstyle="single" _lookuptypes="2,8" _lookupbrowse="0"><A title="Click to select a value for Company." tabIndex=-1 onclick=previousSibling.click(); href="#"></A></TD></TR></TBODY></TABLE>';
lookupCell.innerHTML='
    相关实体';

    2011年有人成功尝试过这个吗

    您正在完全替换查找控件。2011年的HTML呈现方式与4.0中的不同。不支持对这些控件的HTML进行任何修改。但是,我在那里看到一些实体查找类型的重写。。。我猜这就是你想要达到的目标,对吗?实现这一点的方法(也不受支持)是覆盖元素的属性(而不是整个控件)

    document.getElementById(“parentcustomerid”).setAttribute(“lookuptypes”,“2”)
    document.getElementById(“parentcustomerid”).setAttribute(“lookuptypenames”,“联系人:2”); document.getElementById(“parentcustomerid”).setAttribute(“lookuptypeIcons”, “/”imgs/ico_16_2.gif“; document.getElementById(“parentcustomerid”).setAttribute(“defaulttype”, "2");

    我发现这方面的更多细节非常有用


    希望能有所帮助。

    我想你需要以下几点


    Xrm.Page.getAttribute(“fieldName”).setValue([new{id:idValue,name:textValue,entityType:typeValue}])

    您能将代码块的格式设置得更清晰吗?还有,2011年?