web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Answered

Bold Text for the Fileds Labels

(0) ShareShare
ReportReport
Posted on by 11
I would like to make the label text in bold. So I would like that the highlighted field name be in bold
 
I've used the offered in another post (https://community.dynamics.com/forums/thread/details/?threadid=9720cfb8-10fb-4966-a069-f44c5310dad5) code, added as a webresource to the field, but have no results.
function setLabel() {
setTimeout(function(){
parent.document.getElementsById(/id-c4d0374d-97fc-ee11-a1fe-000d3ab2c9f3-2-cr32a_warrantycomment-field-label/).style.fontWeight = 'bold';
 
}, 2000);
}
I assume that I give the wrong parameter for the function - I've put the Label ID or maybe syntax is wrong, or I shoud put in brackets the logocal name.
Would be grateful for the help.
 
I have the same question (0)
  • Suggested answer
    Dengliang Li Profile Picture
    Microsoft Employee on at
    Hi,
     
    In my testing, I bolded the label of the Fax field in the account entity.
    First get the labelHTML element of the target field.
    The code is below.
     
    function onload() {
            //Gets the HTML div tag where the field label is located.
            var div = window.top.document.querySelector("div[data-control-name='fax']");
     
            if(!div){
                    //If the HTML has not finished loading, fetch it after 10 milliseconds.
                    setTimeout(onload,10)
            }else{
                    //Bolds the label text.
                    var fax = div.querySelector("label");
                    fax.style.fontWeight = "bold";
            }
           
    }
     
    If my answer was helpful, please click Like, and if it solved your problem, please mark it as verified to help other community members find more.
    If you have further questions, please feel free to contact me .
     
    Best Regards,
    Dengliang Li
     
     
  • Mrs.Andrus Profile Picture
    11 on at
    Dengliang Li, Thank you for the help.
    I've applied the solution according to my field and appropriate label 
    and changed the code to 
    ___________________________________________________________________________________________________________________
    _____________________________________________________________________________________________________________________
    I've added the code as a webresource to the field and onLoad to the form, but unfortunately can see no changes. I assume, that I am making the wrong steps adding the webresource.
     
  • Verified answer
    Dengliang Li Profile Picture
    Microsoft Employee on at
    Hi,
     
    I add web resource to the account form as shown below.
     
    You can check if you have added it correctly or if it is the right code by searching for the web resource you have added using Ctrl+P in the back-end of your browser.
     
    Best Regards,
    Dengliang Li
     
  • Mrs.Andrus Profile Picture
    11 on at
    Dengliang Li, I am very grateful for the help! I found the tiny typo in my code. Now it works! Thank you very much!

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 171 Super User 2025 Season 2

#2
#ManoVerse Profile Picture

#ManoVerse 83

#3
Jimmy Passeti Profile Picture

Jimmy Passeti 50 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans