Capitalizing first letter of column label

Theja Yamjala
Tera Expert

I have a requirement that change column label to first letter capital only. Ex: "Account Relationship", I want this to be a "Account relationship". I know change label from dictionary but I have more than one on a table.

Can please some one tell me is there any chance to write script to change automatically these field label to first letter upper case format. and where do i write that (business rule/background script).

1 ACCEPTED SOLUTION

SanjivMeher
Kilo Patron
Kilo Patron

 

 

You can try with a background script or fix script. Below is a script you can try. I have added setLimit to limit it to 10 labels. If it works fine, you can remove it. Or add your query to limit it to a table etc.

 

var lb = new GlideRecord('sys_documentation');
lb.setLimit(10);
lb.query();

while (lb.next())
{
var str = lb.label;
lb.label = str.charAt(0).toUpperCase() + str.slice(1);
lb.update();
}

 


Please mark this response as correct or helpful if it assisted you with your question.

View solution in original post

2 REPLIES 2

Saurabh Gupta
Kilo Patron
Kilo Patron

Hi,
You can write one time fix script for the same.

 

 


Thanks and Regards,

Saurabh Gupta

SanjivMeher
Kilo Patron
Kilo Patron

 

 

You can try with a background script or fix script. Below is a script you can try. I have added setLimit to limit it to 10 labels. If it works fine, you can remove it. Or add your query to limit it to a table etc.

 

var lb = new GlideRecord('sys_documentation');
lb.setLimit(10);
lb.query();

while (lb.next())
{
var str = lb.label;
lb.label = str.charAt(0).toUpperCase() + str.slice(1);
lb.update();
}

 


Please mark this response as correct or helpful if it assisted you with your question.