CA Service Management

 View Only

fetch_more 

Dec 15, 2015 07:07 AM

SPEL API methods

fetch_more

 

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

 

 

Definition:

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");   
who=msg[0];  
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
  return;  
  }  
 }

Statistics
0 Favorited
8 Views
0 Files
0 Shares
0 Downloads

Tags and Keywords

Related Entries and Links

No Related Resource entered.