how to list more than 1000 records using listcallback in javascript from a collection

371 views
Skip to first unread message

masak...@gmail.com

unread,
Feb 18, 2014, 3:49:33 AM2/18/14
to suppor...@runmyprocess.com
Hi Team,

I need to get email ids of all users in my applications.But am not able to list more than the first 1000 objects through listcallBack() method in java script. Could you please help me with this!


regards,
masakinirao

Sabine El Rassy

unread,
Feb 18, 2014, 5:03:28 AM2/18/14
to RunMyProcess Support Forum
Hello Masakinirao,

This tutorial shows you how to do that in Freemarker so you can take a look a try to do your own recursive function in JS.

If you need more help, please do not hesitate to contact us back.

Regards,

Sabine

masak...@gmail.com

unread,
Mar 14, 2014, 1:38:14 AM3/14/14
to suppor...@runmyprocess.com, masak...@gmail.com
Hi Sabine,

As suggested by you I have tried to implement the same logic in java script but couldn't get it!!.Please help me with out its urgent !!!


regards,
masakinirao.

Richard Manga

unread,
Mar 14, 2014, 5:46:34 AM3/14/14
to suppor...@runmyprocess.com, masak...@gmail.com
Hi Masakini,

Please can you send me your JS code?

Regards,

Richard Manga.



--
Fujitsu - RunMyProcess
---
You received this message because you are subscribed to the Google Groups "RunMyProcess Support Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to supportforum...@runmyprocess.com.
To post to this group, send email to suppor...@runmyprocess.com.
Visit this group at http://groups.google.com/a/runmyprocess.com/group/supportforum/.
To view this discussion on the web visit https://groups.google.com/a/runmyprocess.com/d/msgid/supportforum/16219dac-84e8-40a3-901c-ea0817de567a%40runmyprocess.com.
For more options, visit https://groups.google.com/a/runmyprocess.com/d/optout.

masak...@gmail.com

unread,
Mar 21, 2014, 1:40:40 AM3/21/14
to suppor...@runmyprocess.com, masak...@gmail.com
Hi Richard,

Am posting the js code.Please help me in listing more than 1000 objects from the collection.

thanks &regards,
masakini.


function validation()
{
var pattern = {};
var options = {};
options.nb = 1000;
options.fields = ["student_create_date"];
col_student_data.listCallback(pattern, options, call_ok, call_ko);
}

function call_ok(result) {

var date_array = [],
final_dates = [];
var date1 = RMPApplication.get("from11");
//getting from_date
var date2 = RMPApplication.get("to11");
//getting to_date

for (var i = 0; i < result.length; i++) {

if (result[i].student_create_date != undefined) {

date_array.push(result[i].student_create_date);
}
}

console.log("the date array is---" + date_array);

var creation_date_from1 = new Date(date1);
var creation_date_to1 = new Date(date2);
creation_date_from1 = creation_date_from1.getTime();
creation_date_to1 = creation_date_to1.getTime();
for (var loop = 0; loop < date_array.length; loop++) {
var d = new Date(date_array[loop]);
d = d.getTime();
if ((creation_date_from1 < d ) && ( d < creation_date_to1)) {

final_dates.push(date_array[loop]);
}
}

console.log("the final array dates are---"+JSON.stringify(final_dates));

var mypattern=
{
"student_create_date":{"$in":final_dates}
}

id_report.setQuery(JSON.stringify(mypattern));
id_report.refresh();
id_report.setVisible(true);
}

function call_ko(result) {

alert("in call ko ----" + JSON.stringify(result));

}



Abdellatif El Alaoui

unread,
Mar 21, 2014, 6:44:04 AM3/21/14
to suppor...@runmyprocess.com, masak...@gmail.com
Hello Masakinirao,
The code bellow allows you to list more than 1000 element from your collection.


*****************************************************
var pagination_iteration=0;
var options={};
options.first=parseInt(pagination_iteration*1000);
options.nb=1000;
col_global_traffic.listCallback({},options,ok_list,ko_list);

function ok_list(result){
   if(result.length==1000){
  /* You can do what you want with the 1000 elements */
pagination_per_thousand();
   }
  else{
return 0;
  } 
 }

function ko_list(result){
alert(JSON.stringify(result));
 }

function pagination_per_thousand(){
   pagination_iteration=pagination_iteration+1;
   var your_pattern={};
   var options={};
   options.first=parseInt(pagination_iteration*1000);
   options.nb=1000;
   col_global_traffic.listCallback(your_pattern,options,ok_list,ko_list);
  }

*****************************************************



Best regards,




--
Fujitsu - RunMyProcess
---
You received this message because you are subscribed to the Google Groups "RunMyProcess Support Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to supportforum...@runmyprocess.com.
To post to this group, send email to suppor...@runmyprocess.com.
Visit this group at http://groups.google.com/a/runmyprocess.com/group/supportforum/.



--

Abdellatif EL ALAOUI

Customer Solution Engineer


Afin de contribuer au respect de l'environnement, merci de n'imprimer ce message qu'en cas de nécessité.
Be environmentally friendly: do not print this email unless it is entirely necessary.

masak...@gmail.com

unread,
Mar 24, 2014, 5:52:12 AM3/24/14
to suppor...@runmyprocess.com, masak...@gmail.com
Hi Abdellatif EL ALAOUI,


Thanks for the support Guys!!.. You are awesome


regards,
masakini.

Reply all
Reply to author
Forward
0 new messages