Assistance Required with Portal Routing Logic Based on User Company
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-23-2024 05:47 AM
Hi Expert
I have a requirement related to portal routing that I need some help with. Here's the scenario:
- If a user belongs to company "ABC," they should be routed to the Service Portal (SP).
- If a user belongs to company "XYZ," they should be routed to the Customer Service Management portal (CSM).
- After logging out, the user should be redirected to the common login page (SP landing page).
I’ve created a new Script Include that inherits the SPEntryPage Script Include. In the initialize function, I added the following code:
When I impersonate a user from company "XYZ," the CSM portal is displayed as expected. However, when I log in using my credentials (from company "XYZ"), it always redirects me to the Service Portal (SP) instead of the CSM portal.
Could you please assist me in resolving this? I suspect there may be an issue with how the user's company is being checked or how the logic is being applied during login.
Looking forward to your guidance on this.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-23-2024 05:52 AM
the 1st case which worked you are impersonating a user from company but in 2nd case you are impersonating as contact user of some account
So try to update as this
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-23-2024 07:01 AM
Hi Ankur,
I have made the changes, but still getting the same error.
But when i impersonate with the same user
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-23-2024 07:07 AM
did you add logs and see ?
for 2nd case you are impersonating user from customer_contact table?
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-23-2024 07:14 AM
I am using sys_user table