- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-24-2016 09:54 PM
Hi,
I have a requirement to hide a specific module based on one of the field on the user table. Initially I thought to create a role, assign that role to the module and add all the filtered users to the role but this is not a perfect solution since the field on the user form can be updated at any time.
For e.g. : I want to hide 'My Asset' module if the users department is either 'India' or 'England'.
Does anybody have any ideas to meet this requirement?
Regards,
Srini
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-24-2016 11:11 PM
Hi
Sorry, Mistake in last reply. In addquery it will be the sysid of the module that you want to hide.Please put sysid of module that you want to hide in addQuery
current.addQuery('sys_id', '!=', 'ec84ca0cdbfa620075d372ffbf9619cc'); //sysid of the module that you want to hide.
var qc1 = current.addQuery('title', '!=', 'My Profile');// this is not required.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-11-2018 05:13 AM
Post Kingston? Which version are you using?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-26-2019 12:30 PM
Hi,
I just wanted to reply to say that I recently was brought with a requirement to hide a module based off of role (which disallowed me the ability to allow...roles...because there was a conflict there...that's another story...). You can use this same method to hide modules based off of really anything...but you need to ensure you do these things:
1) Use the sys_app_module table for your Business Rule
2) Run Before
3) Query type
4) Use script/advanced section to set the visibility by using something like this:
if (gs.getUser().hasRole('itil')) {
current.addQuery('sys_id', '!=', 'sys_id_of_module');
}
To get the sys_id of the module, you can hover the module in left-hand navigation and click pencil icon, which will take you to the settings page...right-click gray header area and choose "Copy Sys ID".
5) This is the most important step that I was initially missing and I figured it out...YOU MUST CLEAR INSTANCE CACHE (type cache.do in to the left-hand navigation search bar) to flush the cache out.
The reason #5 is necessary is because the modules are stored in the cache...so if you're now trying to limit it and it was already there before the BR was created/active...then it will appear to not work. Clearing the cache sort of resets the module appearance and the BR then takes effect.
Please mark reply as Helpful/Correct, if applicable. Thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!