0

このコードは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>';

誰かが2011年にこれをうまく試しましたか?

4

2 に答える 2

0

次のものが必要だと思います

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

于 2012-04-20T03:13:51.247 に答える
0

ルックアップ コントロールを完全に置き換えています。2011 では、4.0 と同じ HTML でレンダリングされません。これらのコントロールの HTML をいじることはサポートされていません。ただし、そこにあるエンティティ ルックアップ タイプのオーバーライドがいくつか見られます...そして、あなたが達成しようとしているのはそれだけだと思いますよね? これを実現する (これもサポートされていない) 方法は、(コントロール全体ではなく) 要素の属性をオーバーライドすることです。

document.getElementById("parentcustomerid").setAttribute("lookuptypes","2");
document.getElementById("parentcustomerid").setAttribute("lookuptypenames", "contact:2"); document.getElementById("parentcustomerid").setAttribute("lookuptypeIcons", "/_imgs/ico_16_2.gif"); document.getElementById("parentcustomerid").setAttribute("defaulttype", "2");

詳細については、Rhett の投稿 (こちら) のコメントが非常に役立つことがわかりました。

それが役立つことを願っています。

于 2012-04-16T14:12:05.517 に答える