[英]getting display name of field in Dynamics CRM 2016
Is there a way to retrieve the display name of a field in MS CRM? 有没有办法在MS CRM中检索字段的显示名称? So far I can only get the schema name;
到目前为止,我只能获得模式名称; but I want to be able to display something a bit more user friendly.
但我希望能够显示一些更加用户友好的内容。 Example below would return
hc_billtimeunit3
but want to return bill time unit
instead. 下面的示例将返回
hc_billtimeunit3
但希望返回bill time unit
。
Xrm.Page.getAttribute("hc_billtimeunit3").getName()
You can use below snippet to get the label text. 您可以使用以下代码段获取标签文本。
Xrm.Page.getControl("attibutename").getLabel();
or 要么
Xrm.Page.ui.controls.get("attibutename").getLabel();
Both are working seemless for me, as Xrm.Page.getControl
method is a shortcut method to access Xrm.Page.ui.controls.get
两者对我来说
Xrm.Page.getControl
都不起作用,因为Xrm.Page.getControl
方法是访问Xrm.Page.ui.controls.get
的快捷方法。
To get display name from CRM entity customizations, you may need another service call. 要从CRM实体定制中获取显示名称,您可能需要另一个服务呼叫。
Xrm.Page.ui.controls.get("attibutename").getLabel();
这实际上为我工作。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.