- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-22-2014 02:19 AM
Hi,
I have a requirement where Manager should be allowed to edit the group members ( add / remove ) of the groups that he / she is managing.
I have created below variables in Catalog item.
1. Reference : User Assignment group table (sys_user_group) : This displays the groups which are managed by 'logged In' user. I put a reference qualifier here to display particular groups.
2. List Collector :
I am thinking to use 'Group Edit' form / page on the Catalog item ( I think this will make my work easier) , pls find the attached screenshot
This form displays the 'existing users' of the groups on the right side and Other users on the left.
Is it possible to have that complete page in the Catalog item ? Where to find that page ?
Is there any other approach you think will be easier ?
Thanks,
Abhijeet
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-22-2014 03:27 AM
here is the code for changing the filter of slush bucket and preloading the selected options on the right side... make changes according to your requirement.. Hope this helps
onchange function()
{
if(!isLoading)
{
//ci is the variable name of slush bucket. replace ci below lines with your variable name
var query = "^u_active=" + newValue+"^name!=";
cig_filter.reset();
cig_filter.setQuery(query);
ciacRequest(null);
if(newValue=='true')
{
setTimeout("defaultSelectedOptions();", 5000);
}
}
}
function defaultSelectedOptions()
{
try
{
var loadInitialValues = '6fd6bc05871d10005ea5476dff434d69,bbd7bc45871d10005ea5476dff434dca'; //values to load
var varName = 'ci'; //slush bucket variable name
var leftBucket = gel(varName + '_select_0');
var rightBucket = gel(varName + '_select_1');
rightBucket.options.length = '0';
var leftOptions = leftBucket.options;
var selectedOptions = loadInitialValues.split(',');
var selectedIDs = new Array();
var index = 0;
for(var i = 0; i < leftOptions.length; i++){
for(var j = 0; j < selectedOptions.length; j++){
if(leftOptions[i].value == selectedOptions[j]){
selectedIDs[index]= i;
index++;
}
}
}
moveSelectedOptions(selectedIDs,leftBucket, rightBucket, '');
}
catch(err)
{
alert(err);
}
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-22-2014 02:52 AM
i do not think that is ui page... the catalog item option should be simple enough to set up and running.... the approach of Mandar Kamtekar seems to be the way to go...

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-22-2014 03:27 AM
here is the code for changing the filter of slush bucket and preloading the selected options on the right side... make changes according to your requirement.. Hope this helps
onchange function()
{
if(!isLoading)
{
//ci is the variable name of slush bucket. replace ci below lines with your variable name
var query = "^u_active=" + newValue+"^name!=";
cig_filter.reset();
cig_filter.setQuery(query);
ciacRequest(null);
if(newValue=='true')
{
setTimeout("defaultSelectedOptions();", 5000);
}
}
}
function defaultSelectedOptions()
{
try
{
var loadInitialValues = '6fd6bc05871d10005ea5476dff434d69,bbd7bc45871d10005ea5476dff434dca'; //values to load
var varName = 'ci'; //slush bucket variable name
var leftBucket = gel(varName + '_select_0');
var rightBucket = gel(varName + '_select_1');
rightBucket.options.length = '0';
var leftOptions = leftBucket.options;
var selectedOptions = loadInitialValues.split(',');
var selectedIDs = new Array();
var index = 0;
for(var i = 0; i < leftOptions.length; i++){
for(var j = 0; j < selectedOptions.length; j++){
if(leftOptions[i].value == selectedOptions[j]){
selectedIDs[index]= i;
index++;
}
}
}
moveSelectedOptions(selectedIDs,leftBucket, rightBucket, '');
}
catch(err)
{
alert(err);
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-22-2014 05:45 AM
Hi Kalai,
It worked for me with modifications. I used below code to search users belong to the selected group
function searchMembers(group){
var answer = '';
var memberGR = new GlideRecord('sys_user_grmember');
memberGR.addQuery('group', group);
memberGR.query();
while(memberGR.next()){
answer += ',' +memberGR.user;
}
return answer;
Surprisingly, Gel () isn't working. So,I used variable names directly.
Thanks for that code. It really helped a lot !
Is there any way to override / code Slushbucket Add/ Remove button code?
-regards,
Abhijeet

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-22-2014 06:00 AM
not sure abt that one... but why do you wanna change the code of add/remove button ?
i am guessing that your are thinking of setting some variable whenever the values are added or removed ...
if that is the case, you can just make use of a onchange script ... why unnecessary messing up of DOM objects
and one more thing mark the question as answered
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-22-2014 06:07 AM
Hi Kalai,
Yes, I want to set variables on click of 'add / remove'. But the event triggers once I click those buttons. ( or double click on the list element ). I guess I need to play with the code of 'Add/remove' button to set variable values.
-Abhijeet