Difference between revisions of "Send WaitCall attrGet groups by persid"

From SDU
Jump to: navigation, search
(New page: __NOTOC__ Category:Customizations Category:r11 Category:r12 Category:Spell Code {{Global Header}} {{Global Announcement}} == Overview == This method gets a list of groups f...)
 
(Usage)
Line 16: Line 16:
 
</source>
 
</source>
  
* timeout - how long (?in seconds?) should the method wait for finishing the method (0 means infinite)
+
* timeout - how long (in seconds) should the method wait for finishing the method (0 means infinite [no timeout] and is generally the value used)
 
* top_object - root object for the method (on which the method is called)
 
* top_object - root object for the method (on which the method is called)
* attr_name - name of attribute on which the action is called
 
 
* contact_persid - persistent ID of an user for which you are looking for attached groups
 
* contact_persid - persistent ID of an user for which you are looking for attached groups
  

Revision as of 13:53, 13 October 2010

To make corrections or additions to this article, select the edit tab above.
To discuss or ask questions about this article, select the discussion tab above.

Overview

This method gets a list of groups for specified user.

This action can be called in spell code in method send_wait (or send) using call_attr action.

Usage

<source lang="javascript"> void send_wait (int timeout, object top_object, "call_attr", "cnt", "get_groups_by_persid", contact_persid) </source>

  • timeout - how long (in seconds) should the method wait for finishing the method (0 means infinite [no timeout] and is generally the value used)
  • top_object - root object for the method (on which the method is called)
  • contact_persid - persistent ID of an user for which you are looking for attached groups

Results

On success the resulted list is filled into a global array msg as follows:

  • msg[0] - the number of assigned groups
  • msg[1] - a list of group's UUIDs

Examples

<source lang="javascript"> int i; send_wait(0, top_object(), "call_attr", "cnt", "get_groups_by_persid", "cnt:776B094702EABB4B87F04A139E72D44B"); for (i=0;i<msg_length();i++) { logf (SIGNIFICANT, "Msg index #%s: %s", i,msg[i]); } </source>

Comment

This code does not work since SD R12.5. See this post: http://www.servicedeskusers.com/forum/index.php?showtopic=6047