- 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-30-2014 08:26 PM
Share your code.. and variable names (label name and database name)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-31-2014 05:12 AM
I used this in a Catalog Client Script, applied to a Catalog Item, onLoad.
The variable name is "requested_for" in the question table. It is a reference to sys_user.
function onLoad() {
//Change the requested for label
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.
}
Thank you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-27-2015 06:23 AM
Mark,
I notice the code for modifying variables works only for variables that are NOT in containers. Or at least that is what my testing shows.
Are variables part of containers have different Element names or something? I'm not a DOM person so I am not sure how to determine what Element to find exactly.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-01-2013 05:49 AM
Thank you so much Mark!!!!!!! I hope it should not impact the other SRs.