How to Redirect the user to the portal and prevent them from accessing the back office

Abderezak ZADRI
Tera Contributor

 

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:

https://www.servicenow.com/community/now-platform-blog/6-ways-to-set-up-your-service-portal-for-redi...

 

I thank you in advance for your help.

ZAK

 

7 REPLIES 7

Sanjay191
Tera Sage

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

       

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

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

Sandeep Rajput
Tera Patron
Tera Patron

@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.