
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-09-2018 12:59 PM
Hey SN Comm!
I want to try something I believe is doable through client script but need some help with it.
I have 3 HR Services that are specific to Employee Relations Cases
- ER Report
- ER Administrative
- ER Union Grievance
Both 2 and 3, need to be available ONLY when someone within the Employee Relations Group is in the system creating their own Cases. Other than that, ER Report can be available all the time.
I was thinking of an onLoad client script (would need to be hitting the Case Creation Page), to only show ER Report when the user creating a new HR Case IS NOT in Employee Relations Assignment Group (or tie it to a role if need be).
Anyone able to work this out with me on how I could get this done? And, if i could do something other than client script?
Thanks to all in advance,
~Rob
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-12-2018 04:25 PM
So the real pain I encountered was, this is a UI page. Even if you modify the reference qualifiers , you will only get it to work on a FORM, not on a UI page.
Achieved it using the Query Business rule on HR services table.
Assign a role to the specific users you want, in my example the role name is "XYZ".
Below is the script
(function executeRule(current, previous /*null when async*/) {
// Add your code here
if(!gs.hasRole("XYZ"))//If the user doesnt have an XYZ role then exclude below HR Services
current.addEncodedQuery("name!=ER Administrative^name!=ER Union Grievance");
})(current, previous);

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-13-2018 06:04 AM
Hey Aman,
So I used your BR option - and while it worked, it also hid those two hr services from a user that has the role I gave. Here below are the details to show you -
The Role I used, which is given to all users within the Employee Relations Assignment Group:
Here is the BR:
I impersonated someone within another group (that does not have this role) and only ER Report showed - great!
Impersonated a user within the ER Group - only ER Report showed up.
Not sure what is missing here since you stated it worked for you.
Thank you!
~Rob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-13-2018 07:08 AM
The event name in the BR should be sn_hr_core.er_writer
Please try that and let me know if it worked.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-13-2018 07:15 AM
Interesting - that was how I first had it, and it did not show that it was working for me. Which made me change it to what I showed you.
Overall, this has worked exactly how I wanted/needed it!
Thank you sir!!!
~Rob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-13-2018 07:20 AM
Good to hear that its working.
Thank you,
-Aman Gurram
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-12-2018 01:04 PM
You can achieve this using the HR Criteria field on the HR Service to only show the Services for users in a certain group.
Example HR Condition on an HR Criteria:
If this comment was helpful or correct, please mark it as such.