简体   繁体   English

在Dynamics CRM 2016中获取字段的显示名称

[英]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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM