【发布时间】:2011-10-17 13:44:27
【问题描述】:
我有名为 RegisteredUser 和 RegisteredApplication 的实体。 RegisteredUser 有一个名为 new_applicationid 的必填字段,该字段使用针对 RegisteredApplication 实体的查找填充。
因此,当我在 CRM 中使用表单创建新用户时,我必须单击查找,找到相关应用程序,然后单击确定。
我的问题是:目前只有一个 RegisteredApplication,我希望在表单加载时预先填充 Lookup。
我想我正在寻找类似的东西
function FormLoad()
{
var app = GetApplications()[0];
//Set a lookup value
var value = new Array();
value[0] = new Object();
value[0].id = app.id; // is this right?
value[0].name = app.name; // is this right?
value[0].entityType = "new_registeredapplication"; // is this right?
Xrm.Page.getAttribute("new_applicationid").setValue(value);
}
function GetApplications()
{
// what do I need to do in here to get a list of
// all the registered applications
}
谁能建议我如何处理这样的事情?
【问题讨论】: