JS操作lookupcontrol-創(chuàng)新互聯(lián)

以contact的parentcustomerid為例,它是一個(gè)lookup field。lookup type為account和contact。默認(rèn)type為accountJS操作lookupcontro
l

如果要設(shè)置默認(rèn)type為contact的話,可以document.getElementById("parentcustomerid").setAttribute("defaulttype", "2"); // 2 是contact object type code

目前成都創(chuàng)新互聯(lián)公司已為超過(guò)千家的企業(yè)提供了網(wǎng)站建設(shè)、域名、網(wǎng)絡(luò)空間、成都網(wǎng)站托管、企業(yè)網(wǎng)站設(shè)計(jì)、新安網(wǎng)站維護(hù)等服務(wù),公司將堅(jiān)持客戶導(dǎo)向、應(yīng)用為本的策略,正道將秉承"和諧、參與、激情"的文化,與客戶和合作伙伴齊心協(xié)力一起成長(zhǎng),共同發(fā)展。

如果lookup type為account和contact,可以document.getElementById("parentcustomerid").setAttribute("lookuptypes", "1, 2");

設(shè)置default view可以Xrm.Page.getControl("parentcustomerid").setDefaultView("E88CA999-0B16-4AE9-B6A9-9EDC840D42D8");

如果想禁止用戶選擇其他的view,可以document.getElementById("parentcustomerid").setAttribute("disableViewPicker", "1");

為lookup字段添加一個(gè)自定義視圖 (addCustomView

var viewId = "{C7034F4F-6F92-4DD7-BD9D-9B9C1E996380}";

var viewDisplayName = "SDK Sample View";

var fetchXml = "<fetch version='1.0' output-format='xml-platform' mapping='logical' distinct='false'>

                                     <entity name='systemuser'>

                                       <attribute name='systemuserid' />

                                       <attribute name='fullname' />

                                       <attribute name='businessunitid' />

                                       <order attribute='fullname' descending='false' />

                                       <link-entity name='businessunit' from='businessunitid' to='businessunitid' visible='false' link-type='outer' alias='a_89c4efa5341e42d5ac34e759aa182065'>

                                         <attribute name='name' />

                                       </link-entity>

                                     </entity>

                                   </fetch>";

Xrm.Page.getControl("parentaccountid").addCustomView(viewId, "account", viewDisplayName, fetchXml, layoutXml, true);

網(wǎng)站標(biāo)題:JS操作lookupcontrol-創(chuàng)新互聯(lián)
分享網(wǎng)址:http://muchs.cn/article8/dddpip.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供云服務(wù)器定制開(kāi)發(fā)、App設(shè)計(jì)、企業(yè)網(wǎng)站制作網(wǎng)站排名、網(wǎng)站策劃

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)

成都定制網(wǎng)站建設(shè)