Need to restrict/hide variable section from RITM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-27-2024 07:21 AM - edited 12-27-2024 07:29 AM
Hi All,
We have a requirement in order to hide variable section from the RITM for all the users except members from the group 'abc' for the catalog item 'Support'.
Step 1: Need to check the cat_item field value is 'Support'
Step 2: check the current user who loads/opens the form is member of the group 'abc'
Step 3: If yes, then he should be able to see the variable section
Step 4: If no, then the variable section and the variable fields inside the variable section should not be visible
Please help me on this.
Thanks,
Joyal Robert
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-27-2024 05:38 PM
Your GlideAjax syntax is wrong.
you didn't do as per what I mentioned. Did you not create display BR on sc_req_item table?
It should work fine. please find the update scripts
Display BR:
(function executeRule(current, previous /*null when async*/) {
// Add your code here
g_scratchpad.isMember = gs.getUser().isMemberOf('5f0ee3b78743e910f956c88e8bbb3789'); // give the group name here
})(current, previous);
onLoad
function onLoad() {
if (g_form.getValue('cat_item') == '81b059c91bbe421083bf86afdc4bcb5f' && g_scratchpad.isMember.toString() == 'true') {
$j('.veditor_header').hide();
$j('.veditor_body').hide();
}
}
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-29-2024 08:27 PM
Hope you are doing good.
Did my reply answer your question?
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader