Widget not showing up under certain circumstances (HRSD Cases)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Wednesday
I'm trying to understand how the HRM Case Info widget determines what info is displayed to certain users.
Specifically, when a person tries to view a HR Case ticket (that they request for themselves) through the "My Requests" page they usually get this:
We have modified our HR intake process so that Managers can request HR services on behalf of their direct reports. So if we set it up so that the Manager requests on behalf of the employee, the following is seen:
Note how the info below the Title of the request is shown when the user is requesting for themselves but not when they request for someone else. How is the HRM Case Info widget set up to display these fields and is there a requirement that the person submitting needs to be the same as the person's name on the ticket?
We don't think there is an issue with the access control for the tickets in question for two reasons: 1) when we attempted to reproduce this with someone with Admin access, they have the same issue as the second screenshot and 2) we attempted to check the access control for the widget itself and both the person who is submitting the tickets and the person who is requesting the ticket for is have the same roles.
Some insight would be useful as to how this specific widget works.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Wednesday - last edited Wednesday
Hi @tahnalos ,
The widget name is HRM Case Info.
The main condition controlling whether the richer information is shown is:
The values used in that condition come from:
data.isApprovalRequired = util.isApprovalRequired(data.parentCaseId, gs.getUserID());
That means the widget is not simply showing fields to anyone who has access to the ticket. It is specifically showing them when the current user qualifies as part of the opened-for view or as an approver.
So in your manager-on-behalf-of scenario, the likely reason the info below the title is missing is that the manager is the submitter/opened_by, but does not satisfy isOpenedForView() for that case. As a result, the widget skips the block that populates those fields.
Kind regards,
An Le
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday - last edited yesterday
Thank you for your help.
What is the data object? I am unclear as to how widgets work. Is openForView a defined attribute?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday - last edited yesterday
Hi @tahnalos ,
data is the server-side model object that gets sent to the client (browser).
You have changed the server code, and server-only should work only if the parent template is what actually renders the fields.
In your case, it looks like the final rendering is delegated to child components, so a server-only change in HRM Case Info may not be enough.
Basically, this is how it works:
HRM Case Info
Responsible for:
case header
title / number / state / updated time
whether tabs load
whether parent-level case info is prepared
whether actions like cancel are allowed
hrm-info-tabs
Responsible for:
tabbed content area
hrMCustomCaseDescriptor
url: https://[your instance]/nav_to.do?uri=sp_angular_provider.do?sys_id=393738df67d31300470f6c3b5685ef9e
Responsible for:
displaying the People row
displaying additional case fields
getportalcontent
url: https://[your instance]/nav_to.do?uri=sys_ws_operation.do?sys_id=2a14574e53000300eb7c0a1806dc3415
Responsible for:
returning the structured data used by the descriptor directive
sn_hr_sp.hr_PortalUtil
url: https://[your instance]/nav_to.do?uri=sys_script_include.do?sys_id=3c764fda534032003585c3c606dc34e9
Responsible for:
deciding what People and Additional fields are available for display
So, besides the widget server script, you need to change the logic behind getportalcontent — most likely sn_hr_sp.hr_PortalUtil.getPeopleInfoFromCaseConfig() and getAdditionalFieldsInfo()because that is the real source of the displayed details.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
Ok so I attempted to modify the code itself with a custom function. The following lines were added to the Widget and the code is still working but the Opened By person still cannot see the data:
The following line was modified:
