Send WaitCall attrSync fetch

From SDU
Revision as of 08:30, 9 September 2010 by Kowy (Talk | contribs)

(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.


This method synchronously fetch list of items from SD database. It can be called in Spell Code using send_wait method.


<source lang="javascript"> void send_wait (int timeout, object top_object, "call_attr", string factory_name, "sync_fetch", string rs_type, string query, int unknown, int param_num [, var parameters]) </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
  • factory_name - the factory you want to call against (could be anything like pcat, cnt, cr, alg, ...)
  • query - query determining what record(s) you want to be returned; query is on an Object level (so you can use similar queries used in Stored Queries, Additional Search arguments or bop_odump command)
  • rs_type - the type of recordset you want returned. Should be one of these options:
    • STATIC
  • unknown - don't know, but usually -1
  • param_num - number of following parameters
  • parameters - variable number of parameters based on given query (for each ? must be exactly one parameter, which value will provide data for corresponding ?)


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

  • msg[0] - the recordset (object)
  • msg[1] - the length of the recordset (records returned, int)


<source lang="javascript"> // get template by its persistent id send_wait(0, top_object(), "call_attr", "cr_tpl", "sync_fetch", "RLIST_DYNAMIC", "template = ?", -1, 1, cr.persistent_id); // get group by id send_wait(0, top_object(), "call_attr", "grp", "sync_fetch", "RLIST_STATIC", "id = ? AND delete_flag = 0", -1, 1, new_group); // get list of all remote referencies send_wait( 0, top_object(), "call_attr","rrf","sync_fetch", "RLIST_DYNAMIC", "", -1, 0); </source>