Send WaitCall attrGet groups by persid

From SDU
Revision as of 11:36, 25 August 2010 by Kowy (Talk | contribs) (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...)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
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)
  • 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

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