0
votes

Is there a way to retrieve the display name of a field in 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.

Xrm.Page.getAttribute("hc_billtimeunit3").getName() 
2

2 Answers

3
votes

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

To get display name from CRM entity customizations, you may need another service call.

1
votes
Xrm.Page.ui.controls.get("attibutename").getLabel();

this actually worked for me.