从javascript打开CRM 2011中字段的查找对话框

时间:2015-06-04 14:58:01

标签: javascript dynamics-crm-2011

如何使用javascript启动查找字段的查找对话框?

1 个答案:

答案 0 :(得分:2)

以下是如何从自定义页面启动查找对话框的示例 - 基于CRM2011(后期汇总12)。

var organizationUrl = "http://servername:5555/organizationName";

//Object Type Code of the entity which needs to be shown in the Lookup.
var objectTypeCode = 1000;

var urlToOpen = organizationUrl + "/_controls/lookup/lookupinfo.aspx?LookupStyle=single&browse=0&showpropbutton=1&AllowFilterOff=1&objecttypes=" + objectTypeCode;

//Get the modal window    
var modalWindow = JSON.parse(window.showModalDialog(urlToOpen, " ", "dialogHeight:600px;"));

//Selected Id will be returned here    
var selectedItemId = modalWindow.items[0].id;