Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Applying Client Script to sys_popup view

alex0g0ward
Kilo Contributor

I am trying to apply a client script to a sys_popup view that will stop an embedded list from being displayed if a user does not have the required role.

The client script I am using thanks to Mark Stanger is (http://www.servicenowguru.com/scripting/client-scripts-scripting/hiding-related-lists-embedded-lists...)

The script is working perfectly on "default view" when applied on a Global basis, but has no effect on the "sys_popup" view.

I have tried creating a non global copy of the client script, specifying the view as "Sys_popup", but no luck.

The client script is running onLoad.

I was wandering if it may not be working due to the nature of the "sys_popup" view, when it is displayed from the hover over, is it actually loading? (would/should it trigger an onLoad client script)

Any help or thoughts would be appreciated

7 REPLIES 7

Kalaiarasan Pus
Giga Sage

Do you have a embedded list in pop up window ? Are you sure it is sys_popup view you are looking at ? Have you tried putting a alert to see if the client script is getting called ?


Yes the embedded list is in the newly created sys_popup view.


It has also been added to the default view.


The client script runs properly in default view (and in the sys_popup when selected in the form itself), but not when sys_popup is used for hover over purposes.


I have not tried an alert, I shall do so.   if not triggered it will confirm my suspicion that hover overs so not trigger onLoad client scripts.


Anurag Tripathi
Mega Patron
Mega Patron

Only way you can modify items visibility on popup view is read access controls( to the best of my knowledge), but applying it to an embedded list will require some serious work.


Also, this will be a global change.


-Anurag

The ACLs applied are all read, as this is not information that should be amended by anyone who is not admin.


The embedded list is visible, as it has been added to the sys_popup view I created, but the lines are removed due to security restraints for ess users, not a major issue as these users are unlikely to ever try and find this information. But from a purist point of view, it takes away from the end user experience if all you can see is "...rows removed due to security restraints".



I may remove the hover over functionality for ess users if this is reported as a problem in the future.