Edit group members Catlog Item

abhiyadav2001
Giga Expert

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

1 ACCEPTED SOLUTION

Kalaiarasan Pus
Giga Sage

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);


      }


}


View solution in original post

22 REPLIES 22

I just wrote a supplementary blog on this.


Unlearn Series - Auto Populate List Collectors


Great job dude !
It works as expected.



Thanks for the help


Jim Coyne
Kilo Patron

You may also want to take a look at Mark Stanger (Crossfuze)'s article on the ServiceNowGuru site - http://www.servicenowguru.com/system-definition/group-managers-manage-group-members/