Document created by Gutis Champion on Dec 15, 2015Last modified by Gutis Champion on Dec 15, 2015
Version 2Show Document
  • View in full screen mode

SPEL API methods



This method fetches more results to object list if not all of them where requested by get_list method.




api_select_count (string, string) ;

uuid - user id

object - object that contains list of the objects

int - number of records to fetch


working example:

uuid who; 
object obList, item;  
int count;
send_wait(0,top_object(), "call_attr", "cnt", "current_user_id");   
send_wait(0, top_object(), "call_attr", "api", "api_select_count", "chg", "active = 1");
if (!msg_error()) {  
printf("change count %d \n",msg[0]);
//10 returned
send_wait(0, top_object(), "call_attr", "api", "get_list", "chg", who, "active = 1", 5);  //we will get first five changes
 if (!msg_error()) {   
 count = msg[1];  
 obList = msg[0];  
 printf("changes count returned %d  \n",count);
 send_wait(0, top_object(), "call_attr", "api", "fetch_more", who, obList, 2); // we will fetch two more
 if (!msg_error()) {
 printf("New change count after fetch more %d \n",msg[0]);
 //check how many changes contains our obList
 send_wait(0, top_object(), "call_attr", "api", "get_list_length", who, obList);     
  if (!msg_error())   
  printf("objlist length after fetch more %s", msg[0]);  
//7 changes returned 5+2