- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-05-2023 01:57 PM
Hi,
The articles in the community show examples of modifying the SPEntryPage script include to customize behaviour such as redirecting users to a specific portal page based on role after login. I did find a KB article (https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0869746) that mentions "...cloning the OOB SPEntryPage" and then setting the system properties to reference the clone instead of the OOTB script.
1. Is it best practices to work on this script directly as I've seen or made a copy?
2. How do you make the copy. I noticed just creating a new script include (and copying the script) creates a script include where the package is "Global" but the OOTB script include has "Service Portal - Core"
3. Whether you modify the OOTB script include or create a copy is this overwritten when you upgrade to a new major version (e.g., Tokyo to Vancouver)?
Thanks a lot.
Regards,
Henry
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-06-2023 01:15 PM
Hi, testing quickly in a PDI I was able to clone the script and did not encounter an error after updating the sy_properties.
How did you create the new\cloned script and is it in the global scope?
To clone I would simply open the existing script, rename it and then use insert and stay to create a new version - renaming should auto update all 'name' references within the script.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-05-2023 11:09 PM
Hi, I believe it is common to update\customize SPEntryPage but I would recommend that your follow the advice provided in KB0869746 and copy\clone the script.
If you customize the existing script-include it would not be overwritten at upgrade as it has changed from OOB.
If you clone the record, your 'new' version will not be overwritten as it is a customization not an OOB record.
Regardless of the approach you take, the SPEntryPage script-include actually being used by the instance will not be updated during an upgrade and so you will need to review any vendor changes and if necessary merge into the script you are using.
The only major difference being that if you use a clone, you have an updated version of SPEntryPage available in your instance (all be it unused), but if you modify the OOB script you would need to either spin up a PDI in order to find a current version or go digging through your skipped upgrade records.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-06-2023 04:52 AM
Thanks a lot for responding so promptly Tony and your insight was helpful. I think creating a copy makes sense as you explained.
if you happen to know where I can look for some guidance on how to properly make a copy/clone of the OOTB script include I would greatly appreciate it. I tried creating a new script include (calling it MPBSDSPEntryPage) and copying the script content as I noted in point 2) but I see from the system log when I try to use it the following warning that I assume is related to the package.
Warning com.glide.script.RhinoEcmaError: "MPBSDSPEntryPage" is not defined.
<refname> : Line(1) column(0)
==> 1: new MPBSDSPEntryPage().getFirstPageURL()
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-06-2023 01:15 PM
Hi, testing quickly in a PDI I was able to clone the script and did not encounter an error after updating the sy_properties.
How did you create the new\cloned script and is it in the global scope?
To clone I would simply open the existing script, rename it and then use insert and stay to create a new version - renaming should auto update all 'name' references within the script.