Onload client script for service portal frontpage
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-09-2018 01:25 AM
Hi,
Does anyone know if it's possible to set up an onload client script only on the service portal so when the user reach the frontpage after logging in then check some user preferences and give a message on the screen that they need to do some action like updating their email under their profile ?
Is that possible ?
Regards
Kim
- Labels:
-
Service Portal Development
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-09-2018 01:30 AM
Hi Kim,
It is not possible with onLoad Client Scripts and all. But if you want to, then you will have to either use Script Include/Business Rule for that OR will have to make changes in SPEntryPage of Portal as per the User Preferences.
Please mark my answer as Correct/Helpful in case that helped you.
Thanks

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-09-2018 01:39 AM
You cannot use a onload client script, you can try to use announcements or embedded help .
https://docs.servicenow.com/bundle/kingston-platform-user-interface/page/build/help-guided-tours/concept/embedded-help.html
https://docs.servicenow.com/bundle/kingston-servicenow-platform/page/build/service-portal/concept/announcements.html
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-10-2018 08:27 AM
What is the "frontpage"? Is that the page they land on after logging in?
If so, is that a Service Portal page?
If it is a Service Portal page you should be able to create a widget that does the checking and displaying of the message.
Then add that widget to the "frontpage"

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-29-2020 03:10 AM
I have a similar requirement. I need to do some logic whenever a user accesses our "/sp" page. For example, no matter where they are within "/sp", I need to check their user record to see if they belong there. If not, redirect them to the proper portal.
I was initially thinking of putting a hidden script in the "Header Menu", but there's no way to do that. Besides, the header menu only loads once, so consequent clicking around in the "/sp" portal wouldn't trigger it.
The only way I can think of right now is to create a widget like this:
and then putting that on every page within the "/sp" portal... but damn.... that's a lot of pages and upkeep!