How to Redirect the user to the portal and prevent them from accessing the back office
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-12-2024 06:18 AM
Do you have any idea how to redirect users who are part of a company X regardless of their role to the portal Emplyee Center and prevent them from accessing the back office?
I have set up redirection rules that work at login, however when you change the URL the user accesses the back office. For information, I followed this link:
I thank you in advance for your help.
ZAK
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-12-2024 06:32 AM
Hello @Abderezak ZADRI
Please Use this line of code In your SPEntry page script include like
if(user.getRecord().getValue('u_opco') == 'ac87bea193d94650da17f3e97bba103a'){
return "/esc/";
}
Just pass the sys_id of the X company.
Please Mark as helpful
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-13-2024 05:52 AM
This solution is only valid when connecting, if a user uses for example https://instancename.service-now.com/incident_list.do, he will be redirected to the list of incidents on the Back-office side
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-13-2024 05:59 AM - edited 09-13-2024 06:01 AM
Hello @Abderezak ZADRI
actually, i explain my usecase what i did i have supplier users if the company will be supplier then that user can only rediret to the supplier portal they can't access the native
So i put the condition in script include SPEntrypage that redirect to the Supplier portal only

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-12-2024 07:58 AM
@Abderezak ZADRI Please refer to this support article https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0746730 to know the steps to check role in SPEntry page and navigate user to platform view or Service Portal depending up on there role.
Hope this helps.