How to set the default page as sp portal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-08-2024 06:46 AM - edited 03-08-2024 06:48 AM
Hi All,
I have a requirement to show portal based on roles.
If user has snc_external_role then only they can se csm portal and rest user can see sp portal
I tried some articles but nothing is working.
And right now it is only redirecting to CSM portal. and sure where this is added.
Pleas help in this.
Thanks,
Sam
- Labels:
-
Service Portal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-08-2024 06:56 AM
Hi @Samiksha2
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-08-2024 07:13 AM
Hi @Samiksha2 ,
- Create or update the system property glide.entry.first.page.script. In some instances, this may already exist, but in many, it will need to be created as a String type property. Make sure to set the value to new SPEntryPage().getFirstPageURL() in order to invoke the SPEntryPage script.
- In the base system, this is set to check if the user has any roles and is not trying to go to the Service Portal directly. If both pass, then it will send them to the value of the glide.login.home property or the page they were attempting to load prior to logging in. If the user does not have any roles, it will send them to the equivalent of that page in Service Portal
For example:
https://<instance_name>.service-now.com/nav_to.do?uri=change_request_list.do
will send non-role users to
https://<instance_name>.service-now.com/sp/?id=list&table=change_request
- In the base system, this is set to check if the user has any roles and is not trying to go to the Service Portal directly. If both pass, then it will send them to the value of the glide.login.home property or the page they were attempting to load prior to logging in. If the user does not have any roles, it will send them to the equivalent of that page in Service Portal
- Configure the SPEntryPage script include to handle your specific needs: NOTE: This requires customization of the base system code. Hopefully, this guide will be helpful in that process however any configuration outside of what is described above is not supported.
- Lines 69 and 70 of the SPEntryPage script are what determines whether or not to redirect a user. You'll see by default that if the user has roles, there is not an existing redirect URL (login_redirect) and the user is not attempting to go to the Service Portal, the script will return - meaning the user is not redirected. In order to tailor this functionality, this function needs to be modified - make sure to leave the second two checks in place or you could break existing functionality. The user.hasRoles check is really the only part that can be modified. For example if you want users with a specific role to go to the platform UI by default, you might change the condition to:
if(user.hasRole("my_cool_role") && !redirectURL && !isServicePortalURL)
- Lines 69 and 70 of the SPEntryPage script are what determines whether or not to redirect a user. You'll see by default that if the user has roles, there is not an existing redirect URL (login_redirect) and the user is not attempting to go to the Service Portal, the script will return - meaning the user is not redirected. In order to tailor this functionality, this function needs to be modified - make sure to leave the second two checks in place or you could break existing functionality. The user.hasRoles check is really the only part that can be modified. For example if you want users with a specific role to go to the platform UI by default, you might change the condition to:
If I could help you with your Query then, please hit the Thumb Icon and mark it as Correct !!
Thanks & Regards,
Sumanth Meda
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-08-2024 09:19 AM
Hi Sumanth,
By default it is taking to the external user to sp user not the CSM portal.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-08-2024 11:02 AM
Hi @Samiksha2 ,
Can you provide me the screenshot of spentrypage script include script which you added ?
If I could help you with your Query then, please hit the Thumb Icon and mark it as Correct !!
Thanks & Regards,
Sumanth Meda