- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-05-2023 11:21 PM
Hi Everyone,
I want to hide a certain HR service in the Transfer Case, both in Native UI and HR Agent Workspace.
Any help is appreciated.
Thanks,
Srinath
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-10-2023 03:00 AM
Ah! my bad I forgot to share the solution for HR Agent Workspace.
Caution: In order to achieve the same functionality on HR Agent workspace, you need to make some changes within an OOTB script include hr_CaseTransferAjax. Any changes here would mean you would need to take care of any changes during upgrades by manually merging them in this script include.
For now let's proceed with how this can be achieved in workspace.
When we closely look at the workspace client script for Transfer case UI Action we find the following.
This UI Action calls an OOTB script include hr_CaseTransferAjax to fetch the possible list of services. When we further drill down in this script include we find a method
On line number 45, replace the existing line with the following.
var oldServices = new sn_hr_core.hr_CaseCreation().getServicesForUser(subjectPerson || '', true);
var services = new sn_hr_core.HRServiceV2().getUpdatedHRServices(oldServices);
rest of the code should remain intact.
Save the changes and test it on workspace this time the excluded services will not appear.
This is how the service dropdown look when the "HR Accounts Inquiry" service is not exlcuded.
This is how it looks when it is excluded.
Hope finally this help you achieve your goal.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-06-2023 09:21 AM
Hi Sandeep,
Can you please instruct me from which line I have to add the query?
Thanks,
Srinath

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-06-2023 10:56 AM
You need to put the HR service check after line number 21.
The recommend way would be to define system property of a comma separated list of sys_ids of those HR services which you do not wish to be a part of the New HR service drop down.
You can access the property on line 22 like the following.
var excludedHRServices = gs.getProperty('excluded.hr.services');
var excludedHRServiceArray = excludedHRServices.split(',');
var sysId = RP.getParameterValue('sysparm_predicted_value');
if(excludedHRServiceArray.indexOf(sysId)==-1){
var gr = new GlideRecord('sn_hr_core_service');
var displayValue;
if(gr.get(sysId)){
displayValue = gr.name;
}
displayValue;
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-07-2023 07:46 AM
Hi Sandeep,
I created a system property for excluding a HR service and used your above query but still I am able to find the HR Service in the transfer case's "New HR service" dropdown. I'm attaching the newly created System Property and modified UI page for transfer case. Please let me know if you can find any errors.
Thanks,
Srinath
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-07-2023 07:53 AM
Hi Sandeep,
I created a new system property and modified the transfer case UI page using your above query. But, still I am able to see the HR service that I want to hide in the transfer case's "New HR Service" dropdown. I am attaching the screenshots of newly created System property and modified transfer case UI page. Please let me know if you spot any errors.
The above image is the modified transfer case UI page.
Thanks,
Srinath