If this works:
Xrm.Page.getControl(name').setLabel('Postal Code') = 'x';
Then why do these all fail:
Xrm.Page.getControl('address1_postalcode').setLabel('Postal Code') = 'x';
Xrm.Page.getControl('address1_stateorprovince').setLabel('Province') = 'x';
Xrm.Page.getControl('address2_postalcode').setLabel('Postal Code') = 'x';
Xrm.Page.getControl('address2_stateorprovince').setLabel('Province') = 'x';
Xrm.Page.getControl('customfield').setLabel = 'x';
('Postal Code);
Xrm.Page.getControl
Please suggest a workaround. Thanks.
*This post is locked for comments
Wendy,
The HTML would not render if you are using the above mentioned method of setting the label.
One workaround would be to do a direct DOM manipulation, such as document.getElementById('yourControlName'), but that would be unsupported customization & not recommended.
Can we set html string in the label ?
Hi,
Instead of changing label using JavaScript.. you can change label from Form customization.. so that all places you will see same label.
All places means, all forms, views, sub grids etc. otherwise you need to change it all the places either by using supported Javascript or unsupported JavaScript.
even if you needed.. you need can change label like
Xrm.Page.getControl('address1_postalcode').setLabel('Postal Code');
Here are more details on form scripting
msdn.microsoft.com/.../gg334266.aspx
msdn.microsoft.com/.../jj602964.aspx
msdn.microsoft.com/.../gg328474.aspx
Hope this will help..
Thanks,
But why do you need a Javascript to change the label on form.
It can be done from the form itself
You're right about that I made this email in haste.
by the way I did not mess a ' character in production. cannot edit post.
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,240 Super User 2024 Season 2
Martin Dráb 230,149 Most Valuable Professional
nmaenpaa 101,156