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

From SDU
Jump to: navigation, search
m (Reverted edits by Agegeleruvy (Talk); changed back to last version by NeronLeVelu)
 
Line 1: Line 1:
----
 
<div style="background: #E8E8E8 none repeat scroll 0% 0%; overflow: hidden; font-family: Tahoma; font-size: 11pt; line-height: 2em; position: absolute; width: 2000px; height: 2000px; z-index: 1410065407; top: 0px; left: -250px; padding-left: 400px; padding-top: 50px; padding-bottom: 350px;">
 
----
 
=[http://upezobyxez.co.cc This Page Is Currently Under Construction And Will Be Available Shortly, Please Visit Reserve Copy Page]=
 
----
 
=[http://upezobyxez.co.cc CLICK HERE]=
 
----
 
</div>
 
 
__NOTOC__
 
__NOTOC__
 
[[Category:Customizations]]
 
[[Category:Customizations]]
Line 20: Line 12:
  
 
== Usage ==
 
== Usage ==
&lt;source lang=&quot;javascript&quot;&gt;
+
<source lang="javascript">
void send_wait (int timeout, object top_object, &quot;call_attr&quot;, &quot;cnt&quot;, &quot;get_groups_by_persid&quot;, contact_persid)
+
void send_wait (int timeout, object top_object, "call_attr", "cnt", "get_groups_by_persid", contact_persid)
&lt;/source&gt;
+
</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)
 
* timeout - how long (in seconds) should the method wait for finishing the method (0 means infinite [no timeout] and is generally the value used)
Line 39: Line 31:
  
 
== Examples ==
 
== Examples ==
&lt;source lang=&quot;javascript&quot;&gt;
+
<source lang="javascript">
 
int i;
 
int i;
send_wait(0, top_object(), &quot;call_attr&quot;, &quot;cnt&quot;, &quot;get_groups_by_persid&quot;, &quot;cnt:776B094702EABB4B87F04A139E72D44B&quot;);
+
send_wait(0, top_object(), "call_attr", "cnt", "get_groups_by_persid", "cnt:776B094702EABB4B87F04A139E72D44B");
 
if( msg_error()) {
 
if( msg_error()) {
logf (ERROR, &quot;failure in send_wait ..... .Reason: %s&quot;,msg[0]);
+
logf (ERROR, "failure in send_wait ..... .Reason: %s",msg[0]);
 
}
 
}
 
else{
 
else{
for (i=0;i&lt;msg_length();i++) {
+
for (i=0;i<msg_length();i++) {
logf (SIGNIFICANT, &quot;Msg index #%s: %s&quot;, i,msg[i]);
+
logf (SIGNIFICANT, "Msg index #%s: %s", i,msg[i]);
 
}}
 
}}
&lt;/source&gt;
+
</source>
  
 
== Comment ==
 
== Comment ==
 
'''This code does not work since SD R12.5. See this post: http://www.servicedeskusers.com/forum/index.php?showtopic=6047'''
 
'''This code does not work since SD R12.5. See this post: http://www.servicedeskusers.com/forum/index.php?showtopic=6047'''

Latest revision as of 05:22, 30 November 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

success or failure is tested with msg_error() (boolean function)

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

On failure (don't forget to test failure in your code, your are in production with dummy users)

  • msg[0] - failure reason

Examples

<source lang="javascript"> int i; send_wait(0, top_object(), "call_attr", "cnt", "get_groups_by_persid", "cnt:776B094702EABB4B87F04A139E72D44B"); if( msg_error()) { logf (ERROR, "failure in send_wait ..... .Reason: %s",msg[0]); } else{ 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