MS CRM-setVisible [英] MS CRM - setVisible

查看:70
本文介绍了MS CRM-setVisible的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是CRM和
的新手,我一直在搜寻如何使用 MS CRM中的 jScript 库隐藏和显示文本字段(在线),发现使用功能 setVisible 的几种选择。



这些选项:


  1. Xrm.Page.ui.tabs.get('new_fieldname')。setVisible(false) ;

  2. Xrm.Page.data.entity.attributes.get('new_fieldname')。setVisible(false);

  3. Xrm.Page.getAttribute('new_fieldname')。controls.get(0).setVisible(false);

但只有最后一个确实有效。
第一个选项给我一个错误消息。



它们之间有什么区别?

解决方案

只需添加到已经提出的要点即可。



$ p $

之间的区别

  Xrm.Page.ui.tabs.get('new_fieldname')。setVisible(false); 

  Xrm.Page.getAttribute('new_fieldname')。controls.get(0).setVisible(false); 

第一个指的是标签 Xrm .Page.ui.tabs ),第二个是指属性 Xrm.Page.getAttribute )。 / p>

因此,如果您想隐藏整个选项卡,其部分和字段,则可以使用第一个选项卡。如果您只想隐藏单个字段,则可以使用

  Xrm.Page.getControl( new_fieldname)。setVisible(false); 

这本身就是

  Xrm.Page.ui.controls.get('new_fieldname')。setVisible(false); 


I am newbie with CRM and I was googling for how to hide and show a text field using jScript library in MS CRM (online) and found several options of using the function setVisible.

I tried those options:

  1. Xrm.Page.ui.tabs.get('new_fieldname').setVisible(false);
  2. Xrm.Page.data.entity.attributes.get('new_fieldname').setVisible(false);
  3. Xrm.Page.getAttribute('new_fieldname').controls.get(0).setVisible(false);

But only the last one is really working. The first option gives me an error message.

What is the different between them?

解决方案

Just to add to the points already made..

The difference between

Xrm.Page.ui.tabs.get('new_fieldname').setVisible(false);

And

Xrm.Page.getAttribute('new_fieldname').controls.get(0).setVisible(false);

The first refers to a tab (Xrm.Page.ui.tabs), the second refers to an attribute (Xrm.Page.getAttribute).

So if you wanted to hide a whole tab, its sections and fields you can use the first one. If you want to just hide an individual field you can use

Xrm.Page.getControl("new_fieldname").setVisible(false);

Which is itself a shortcut from

Xrm.Page.ui.controls.get('new_fieldname').setVisible(false);

这篇关于MS CRM-setVisible的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆