
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-19-2022 06:30 AM
Hello SN Developers!
I have an onLoad event that is supposed to hide an option on a field if the user does not have a specific role (and conversely, add the option if they do). I know the code is firing correctly because of the alerts I put in but the option is not working as expected.
Here's my code:
Any thoughts/suggestions?
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-19-2022 08:06 AM
@Maria20, yes thats actually the issue. The removeOption function does not work for reference fields. There you will have to use „reference qualifiers“ or ACL rules.
Greetings,
Sören

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-19-2022 08:36 AM
Thank you both for your help.
Maria.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-19-2022 08:17 AM
Hello,
As Soeren suggested,
Removing options will not work on a reference field. It's only valid if it were a choice field.
In this case you would need to create an advanced reference qualifier

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-19-2022 07:53 AM
Hello Soren,
Thanks for the reply. So, "application" is my field name and "WFM Time Clocks" is one of the drop-down values. It is a CI so I don't see a "value" field in the CI form. I have tried with the sys_id and that doesn't work either.
I understand your reasoning for only using the .hideOption and I've tried that with no success. The only reason I had both in my code was to try to get it to trigger properly (i.e. show me the correct alert) and it is definitely doing that.
The .hideOption is not working though.
Maria.