- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-26-2016 01:27 AM
Hi All
I want to find out what function is used to get all the child groups of a perticular group. There are two fields in my table, Approval level and approval group. Both the fields are reference field refering sys_user_group. If we choose a group in approval level , then the sub group or the child group of this group should come in the approval group lookup icon.
I know this can be done with script include but in the script after query i don't know which function or condition should be used to get child group of that group. Please help if you can.
Thankyou
Devina Khare
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-27-2016 02:18 AM
Unable to find any OOB Script include for this, why not use your own SI?
code would be:
var GetChildGroups = Class.create();
GetChildGroups .prototype = {
initialize: function() {
},
var x[];
childGroups: function(parentGroup) {
var gr=new GlideRecord(sys_user_group')
gr.addQuery('parent',parentGroup);
gr.query();
while gr.next()
{
x.add(gr.sys_id);
}
return x;
},
type: 'GetChildGroups'
}),
Let me know if this helps
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-27-2016 02:18 AM
Unable to find any OOB Script include for this, why not use your own SI?
code would be:
var GetChildGroups = Class.create();
GetChildGroups .prototype = {
initialize: function() {
},
var x[];
childGroups: function(parentGroup) {
var gr=new GlideRecord(sys_user_group')
gr.addQuery('parent',parentGroup);
gr.query();
while gr.next()
{
x.add(gr.sys_id);
}
return x;
},
type: 'GetChildGroups'
}),
Let me know if this helps
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-28-2016 01:39 AM
Thanks a lot
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-12-2019 03:09 AM
code is not working please send correct code