Hi,
Below is the sample JScript to change the color and text of CRM form field’s label; Place the code in JScript “onload” event
// To change color
if(crmForm.all.new_fieldname != null) {
var field = crmForm.all.new_fieldname_c; //”_c” is the caption (i.e.,Label)
if (field != null)
field.style.color = ‘gray’; //Specify your desired color
}
Same script work for both CRM 4.0 & CRM 2011
// To set the label
Xrm.Page.ui.controls.get(fieldname).setLabel(‘New label’);
🙂

![[Step by Step] Beginner : Create a PCF control and add it to a custom page](https://rajeevpentyala.com/wp-content/uploads/2024/12/image-49.png)

Leave a reply to Chris Cancel reply