- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-01-2013 02:29 AM
Hello Everyone!!!!
This is my project requirement that I am using the variable set - 'Requested For' in every SR. Exceptionally, in one SR, I have to change either its Label Name to "ID Name" or its Help Text that will lead to change in its behaviour in other SRs as well. But I dont want to affect the behaviour of "Requested For" in other SRs.
I want to change the Label of 'Requested For' on form loading without affecting the same in other SRs.
I tried the solution posted by Mark, http://www.servicenowguru.com/system-ui/ui-scripts-system-ui/modifying-label-form-fields-client-scri...
It works good for fields, not for variables.
Can anyone please help me in this or suggest something...
Regards/Neetu
Solved! Go to Solution.
- Labels:
-
Service Catalog
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-29-2014 08:06 PM
Try this -
function onLoad() {
var field = 'requested_for'; // requested_for is the database name for the variable
var labelElement = $('label_' + g_form.getControl(field).id).select('label')[0];
labelElement.innerHTML = 'Requested By'; // Requested By is the label name.
}
It should help..

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-01-2013 05:14 AM
Look in the comments on that article. There's a script supplied there that works for catalog variables.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-28-2014 12:38 PM
Hi,
I applied the catalog variable version (in a Catalog client script) and it did not work:
function onLoad() {
//Change the "Requested For" label to "Requested By"
changeFieldLabel('Requested For', 'Requested By');
}
function changeFieldLabel(field, label){
try{
var labelElement = $('label_' + g_form.getControl(field).id);
labelElement.select('label').each(function(elmt) {
elmt.innerHTML = label;
});
}catch(e){}
}
Any idea where I've gone wrong?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-29-2014 08:06 PM
Try this -
function onLoad() {
var field = 'requested_for'; // requested_for is the database name for the variable
var labelElement = $('label_' + g_form.getControl(field).id).select('label')[0];
labelElement.innerHTML = 'Requested By'; // Requested By is the label name.
}
It should help..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-30-2014 06:20 AM
Hi,
It did not work, the original (Requested For) label remains intact.