2013-05-17 49 views
0

我有一个Dynamics 2011窗体上的自定义查找。我也有一个JavaScript库来做各种基本的验证。我的问题是,如何在javascript中查找一个值?下面的JavaScript不起作用...请参阅图像。在Dynamics中查找项目选择

任何帮助表示赞赏!

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); 

回答

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 
    } 
} 
+0

这工作,谢谢。 – GrumP

相关问题