Hiding reference (Magnifying glass) on Service Catalog for all fields or single field.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-05-2013 08:29 AM
I am trying to figure out a way to hide the reference magnifying glass icon on the Service Catalog. I know how to use jquery or getElelmentByID; and it works on the incident form and other forms; but it the same code will not work on the Catalog.
This is just one example I am using that works everywhere else except the catalog.
disableMagnifyingGlass1 = document.getElementById('lookup.ReferenceFieldName');
disableMagnifyingGlass1.style.display = 'none';
Any ideas?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-05-2013 09:10 AM
You can make the reference look up non clickable:
See this link:
http://wiki.servicenow.com/index.php?title=Customizing_the_Reference_Icon
Ravali
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-05-2013 11:49 AM
Here is the html for the reference field magnifying glass in our instance (Aspen):
<a id="lookup.IO:cc41d69f2b600100200ff79069da1545" onclick="mousePositionSave(event);reflistOpen( 'IO:cc41d69f2b600100200ff79069da1545', 'not', gel('IO:cc41d69f2b600100200ff79069da1545TABLE').value, '', 'false', 'true')" style="padding-right:4px;" tabindex="1"><img width="18" height="16" border="0" src="images/reference_list.gifx" title="Lookup using list"></img></a>
Your element ID will probably be different, just check the page source.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-05-2013 12:15 PM
Yes, thank you. I've tried the ID 'IO:SYSID' too. It also works on forms, just not Service Catalog.
It's as if the catalog ignores jquery all together for those items.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-29-2015 08:06 PM
Hi,
Put this together to solve this one...
function lookupHider(theField){
//Sets the placeholder for a reference field
var nameID = g_form.getControl(theField).id;
var theSelector = "a[id*=" + '"lookup.' + nameID + '"]';
var d = document.querySelector(theSelector);
d.style.display = "none";
}
Just use this function in your client script like this:
lookupHider('u_requestor');