How to override system UI properties for specific fields?

Nick Simonelli1
Mega Expert

I have seen some partial solutions but haven't really come up with a good working solution as of yet. My use case is as follows:

Setup) I have glide.ui.clickthrough.popup set to true because for 99% of our users this behavior is more useful and preferred.

However, since the popup does not load related links (due to the sysparm_referring_url = tearoff), this is not working well for people with Request Item tickets. The users fulfilling request items like to be able to click on the reference icon next to the "Request" field on the form and be able to use the related links at the bottom to finish their requests.

find_real_file.png

(Example of the reference Icons I am referring to)

So, is there:

1) A way to have glide.ui.clickthrough.popup = false for Request only and not for the rest of our instance?

2) If not, how would I override the URL when it opens in a new window to remove the "sysparm_referring_url" portion? I have seen this Reference Icon click open in new window which states that a UI Action should be able to do it, but I am unsure of how to trigger that UI action when clicking on the reference icon? Excuse me, I am very new to ServiceNow. Thanks in advance for any assistance!

1 ACCEPTED SOLUTION

michael_baker
Tera Guru

Hi Nick,



You could create an onLoad Client Script on the Request (sc_request) table that runs the following script.   This will remove the "tear_off" portion of the URL and load the related lists.



function onLoad() {


        var href = document.location.href;



        if (href.indexOf('sysparm_referring_url=tear_off') != -1) {


                  href = href.replace('sysparm_referring_url=tear_off', 'sysparm_referring_url=');


                  document.location.href = href;


        }


}



Hope this helps!


View solution in original post

4 REPLIES 4

michael_baker
Tera Guru

Hi Nick,



You could create an onLoad Client Script on the Request (sc_request) table that runs the following script.   This will remove the "tear_off" portion of the URL and load the related lists.



function onLoad() {


        var href = document.location.href;



        if (href.indexOf('sysparm_referring_url=tear_off') != -1) {


                  href = href.replace('sysparm_referring_url=tear_off', 'sysparm_referring_url=');


                  document.location.href = href;


        }


}



Hope this helps!


Wow, I spent much more time yesterday than I would like to admit trying to figure this out. It works wonderfully, thank you so much! Out of curiosity, what is the importance of "   if (href.indexOf('sysparm_referring_url=tear_off') != -1) "? Is it just saying "If sysparm_referring_url=tear_off exists?"


Either way, thanks so much!


This was added to stop it from entering a loop of reloading, which it did during my test


Genius... just really, really great. Thanks again so much.