Hide a speciifc HR service in Transfer Case

Srinath S
Tera Contributor

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 

1 ACCEPTED SOLUTION

@Srinath S @Emi Nem 

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.

Screenshot 2023-04-10 at 3.19.11 PM.png

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 

_getServices: function(subjectPerson) { on line number 44, which actually returns the list of services. 
 
This is actually the place where you need to make the changes.
Screenshot 2023-04-10 at 3.25.00 PM.png

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.

Screenshot 2023-04-10 at 3.08.37 PM.png

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.

Screenshot 2023-04-10 at 3.07.23 PM.png

 

This is how it looks when it is excluded.

Screenshot 2023-04-10 at 3.12.14 PM.png

Hope finally this help you achieve your goal.

View solution in original post

12 REPLIES 12

Hi Sandeep,

I implemented the above solution and it works great, but it is only working in Native UI. I am able to see those HR service that should be hidden in the HR agent workspace's transfer case. Do I have to make any changes to your Script include and Transfer case UI page to make it reflect in HR Agent workspace too? I have to hide it from both HR agent workspace and Native UI. I am attaching the screenshot of transfer case in HR Agent workspace which was showing even after I followed your code and instructions.

 

Thanks,

Srinath

@Srinath S @Emi Nem 

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.

Screenshot 2023-04-10 at 3.19.11 PM.png

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 

_getServices: function(subjectPerson) { on line number 44, which actually returns the list of services. 
 
This is actually the place where you need to make the changes.
Screenshot 2023-04-10 at 3.25.00 PM.png

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.

Screenshot 2023-04-10 at 3.08.37 PM.png

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.

Screenshot 2023-04-10 at 3.07.23 PM.png

 

This is how it looks when it is excluded.

Screenshot 2023-04-10 at 3.12.14 PM.png

Hope finally this help you achieve your goal.

Sybol DG
Tera Contributor

Good morning everyone .