我在Dynamics 2011表单上有自定义查找。我还有一个javascript库来做各种基本验证。我的问题是,如何使用javascript指向查找中的值?以下javascript不起作用...也请看图片。
任何帮助表示赞赏!
http://i.imgur.com/d8vN0H5.png查找
if (Xrm.Page.getAttribute("new_contactmethod").getValue() == Jog)
{
Xrm.Page.ui.tabs.get("WorkoutDetails").sections.get("Section_Workout").setVisible(true);
}
else
{
Xrm.Page.ui.tabs.get("WorkoutDetails").sections.get("Section_Workout").setVisible(false);
Xrm.Page.getAttribute("new_distance").setValue(null);
答案 0 :(得分:1)
您可以通过以下方式检索查找名称:
var methodValue = Xrm.Page.getAttribute("new_contactmethod").getValue();
// we check if the lookup is not empty
if (methodValue != null) {
var methodName = methodValue[0].name;
if (methodName == "Jog") {
// your code here
}
else {
// your code here
}
}