- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā03-01-2024 08:14 AM - edited ā03-01-2024 08:36 AM
Hi!
We are working to onboard the Employee Relations module and the new, configurable Agent Workspace for HR Case Management. Since they are new to HR Case management, we want the team to work out of the Agent Workspace for HR Case Management. We do not want them to get confused when clicking links from emails or from lists and viewing records in the classic view. From research, it seems as though Navigation Handlers would work best for this.
I created a new role, see screenshot below, and assigned it to the respective groups and users.
I created a Navigation handler for the sn_hr_er_case table with the following Script:
var answer = g_uri.toString();
if (!gs.getUser().hasRoles('sn_hr_core.workspace_view'))
answer = "/now/hr/agent/record/" + current.getRecordClassName() + "/" + current.getUniqueValue();
else
answer = "/now/nav/ui/classic/params/target/" + current.getRecordClassName() + "%3Fsys_id%" +current.getUniqueValue();
The glide.ui.view_rule.check_after_nav_handler system property has a value = true. So the Navigation Handler should be triggered before the view rules.
As a user with the workspace_view role, I log into the platform, navigate to All --> Employee Relations --> Cases. I click on a Case record and it opens it in classic view, not the workspace.
NOTE: I tried using 'workspace_view' in the script for hasRoles, and that did not work either.
To help compare to the script, when logged in as the user:
Here is the url suffix when viewing a case from Agent Workspace for HR Case Management:
- /now/hr/agent/record/sn_hr_er_case/4caf464a47c40210d1a5b6bf016d439c
Here is the url suffix when clicking a case record from the list:
- /now/nav/ui/classic/params/target/sn_hr_er_case.do%3Fsys_id%3D56f9ebaa3b630010d901655593efc457%26sysparm_record_target%3Dsn_hr_er_case%26sysparm_record_row%3D6%26sysparm_record_rows%3D202%26sysparm_record_list%3DORDERBYDESCnumber
I also updated the Navigation Handler for the sn_hr_core_case table as well...
var answer = g_uri.toString();
if (!gs.getUser().hasRoles('workspace_view'))
answer = "/now/hr/agent/record/" + current.getRecordClassName() + "/" + current.getUniqueValue();
else
answer = "/now/nav/ui/classic/params/target/" + current.getRecordClassName() + "%3Fsys_id%" + current.getUniqueValue();
Here is a snapshot of the role I created:
I used this post to help get me started...
Any help to get this to work would be greatly appreciated.
Jeremy
Solved! Go to Solution.
- Labels:
-
Workspace : Next Experience
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā03-01-2024 11:54 AM
Hey @JeremyHoffman,
Haven't seen functionality before, very interesting.
I have tested the following script in the PDI and it's working as expected. You nearly had it, just a few minor changes;
if (gs.getUser().hasRole('sn_hr_core.workspace_view'))
answer = "/now/hr/agent/record/" + current.getRecordClassName() + "/" + current.getUniqueValue();
else
answer = "/now/nav/ui/classic/params/target/" + current.getRecordClassName() + "%3Fsys_id%" + current.getUniqueValue();
Hope it helps, cheers
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā03-01-2024 11:54 AM
Hey @JeremyHoffman,
Haven't seen functionality before, very interesting.
I have tested the following script in the PDI and it's working as expected. You nearly had it, just a few minor changes;
if (gs.getUser().hasRole('sn_hr_core.workspace_view'))
answer = "/now/hr/agent/record/" + current.getRecordClassName() + "/" + current.getUniqueValue();
else
answer = "/now/nav/ui/classic/params/target/" + current.getRecordClassName() + "%3Fsys_id%" + current.getUniqueValue();
Hope it helps, cheers
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā03-01-2024 12:49 PM
@James Chun This is great and it works for me too! Thank you! You just made my week. Getting this figured out will allow me to enjoy my weekend without dwelling on how to get this to work.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā06-04-2025 10:11 AM
This is very interesting and glad it was working for you! I'm curious about creating navigation handlers for HR Agent Workspace itself -- i.e., how we might redirect non-agent users from an accidental Agent Workspace record view back to our general portal. It seems like navigation handlers are only intended for the Core UI. Have you come across any other methods during your work on the original issue?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā07-03-2025 05:01 AM
Hi @Zach3
I am not quire following your ask, sorry. We use the navigation handler for HR Agent workspace specifically for the ER case writer role. We have not expanded it out yet to include the core case writer role.
I would have to check, but I do believe we have navigation handlers to check the role and if they do not have any case role, it takes the end user to the portal view of the case. We do this for Incidents and Requests as well.
Another use case I could use using it is for the Service Operations Workspace, thinking the itil and walk up user roles.
Kind regards,
Jeremy