Re-sizing a reference variable width in the item and/or task
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-15-2015 01:52 PM
Hello,
I found an article on how to re-size a reference variable in the catalog item. Here is the link https://community.servicenow.com/thread/177647
Here is the code used
var myVar = $('sys_display.' + g_form.getControl('<variable name>').id); //Get the correct reference element
myVar.style.width = '350px'; //Set the width
It works well in the catalog item but it does not work in the item or task. I tried to change the name and tried a few other options that I found
g_form.getControl('variables.name').style.width = '350px';
for (var i = 0; i < g_sc_form.nameMap.length; i++) {
if (g_sc_form.nameMap[i].prettyName == '<variable name>') {
g_form.getControl(g_sc_form.nameMap[i].realName).style.width = '350px';
}
}
So far, no luck.
Any of you have some other ideas to get it to work in the item and task as well.
Thanks...Jim
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-11-2016 06:41 AM
THANK YOU BILLY!! This looks promising. I'll let you know after I do some further testing.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-12-2016 02:34 AM
Hi Billy,
Thanks very much for this. I was testing using a different piece of code to increase the size of a reference field but found that while it worked ok on the catalog item, it was not working on the request item and tasks and was also causing issues with UI policies that I had in place on these.
Just tested your code now and after initial testing, it looks to be doing exactly what I needed. Many thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-12-2016 06:37 AM
Thanks Billy! After further testing, it looks like your code did the trick!
Regards,
Johnny