CA Service Management

 View Only

get_group_list 

Dec 20, 2017 09:34 AM

SPEL API methods

get_group_list

 

Gets from grpmem table list of the user groups. Returns number of objects found and object list as the object. Most often it should be used in conjunction with dob_by_index method.

 

Definition:

get_group_list (string) ;

string - user persistent_id

 

 

working example:

 

uuid who;  
int count, i; 
object obList, atev_dob; 
 
send_wait(0,top_object(), "call_attr", "cnt", "current_user_id");   
who=msg[0];  

send_wait(0, top_object(), "call_attr", "api", "get_group_list", format("cnt:%s", who));
     if (!msg_error()) {  
      count = msg[1]; 
      obList = msg[0]; 
     // printf(msg[1]); 
           for (i=0;i<count;i++) {

                         send_wait(0, obList, "dob_by_index", "DEFAULT", i, i);
                         if (!msg_error()) {
                              atev_dob = msg[0];
                              printf("%s ",atev_dob.member.last_name);
                              printf("%s \n",atev_dob.group.last_name);
                         }
                         else
                         {
                              printf("get_group_list %s",msg[0]);
                         }     
           }
     }
     else{
          printf("get_group_list %s",msg[0]);  
     }

Statistics
0 Favorited
19 Views
0 Files
0 Shares
0 Downloads

Tags and Keywords

Related Entries and Links

No Related Resource entered.