- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-09-2022 10:02 PM
If the User is belongs to Service Desk group member then only populate Manager field on incident form , need to achieve this by using Display BR
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-09-2022 10:39 PM
HI
Try below...Working...Tested..
Create Display Business rule and use the below code..
(function executeRule(current, previous /*null when async*/) {
g_scratchpad.checkuser = gs.getUser().isMemberOf(gs.getProperty('checkUserInGroup'));
})(current, previous);
Note: As part of best practice, I have used "System Property" instead of passing group name directly here..
To create system Property do like below screenshot.
1. In Navigator type "sys_properties.LIST" and create a new one as below.
In Value pass the group SysId and in type select as "String"
Then Create Client script and use the below code.
if (g_scratchpad.checkuser == true) {
g_form.setValue('u_manager_new', g_user.userID);
}
I hope it definitely helps you, if so please mark my response as correct and helpful
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-09-2022 10:04 PM
Hi,
populate manager field with what?
which user? logged in user?
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-09-2022 10:13 PM
Hi Ankur,
Thanks for responding.
I think with logged in user , if we select random user in incident caller id field belongs to service desk group , in this case we can't use Display BR i think so,
So pls help me with possibility way with using Display BR case.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-09-2022 10:16 PM
Hi,
Display BR would run only once when form loads
If you wish to do this check when caller is changed then you need to use onChange client script + GlideAjax
In script include check if caller is member of that group and return true or false
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-09-2022 10:28 PM
Yes i got, but i need to do this using Display BR,
may be we can write for logged in user ,
when form loads then logged in user caller_id should be populate for Service Desk group members only.