Aggregate call back

25 views
Skip to first unread message

vinod...@gmail.com

unread,
Jul 10, 2016, 5:39:29 AM7/10/16
to Fujitsu RunMyProcess Developer Community, vk, Vinod Varma
Hi

I am trying to use aggregateCallback. It is able to pick data for state but shows zero for Total (screenshot attached)

I have used script (changing only the collection name) and collection columns as given in https://docs.runmyprocess.com/Developer_Guide/Collection/Collection_JS_Freemarker#aggregation_1

var my_object = {};
my_object.first_name=id_first_name.getText();
my_object.last_name=id_last_name.getText();
my_object.state=id_state.getText();
my_object.nb_of_cars=id_no__of_cars.getText();
my_object.nb_of_motors=id_no__of_motors.getText();

col_my_collection.saveCallback(my_object, add_ok, add_ko);

Am I missing something? Request help

Thanks in advance

Regards


Vinod

aggregate1.png

Pankaj Kumar

unread,
Jul 10, 2016, 5:51:45 AM7/10/16
to Fujitsu RunMyProcess Developer Community
Hi Vinod,

Please check the collection data and field "nb_of_cars" is populated and have some value. If yes, than one possibility is you are using,getText method, which return string not number,

my_object.nb_of_motors=id_no__of_motors.getText();

Please try,

 my_object.nb_of_motors=parseInt(id_no__of_motors.getText());

in-order to aggregate method "sum" works correctly.

Thank you,
Pankaj Kumar
Fujitsu RunMyProcess Support



Vinod

--
Fujitsu - RunMyProcess
---
You received this message because you are subscribed to the Google Groups "Fujitsu RunMyProcess Developer Community" 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 https://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/60905545-8714-417d-a7eb-be9e3534537a%40runmyprocess.com.
For more options, visit https://groups.google.com/a/runmyprocess.com/d/optout.

vinod...@gmail.com

unread,
Jul 10, 2016, 6:29:34 AM7/10/16
to Fujitsu RunMyProcess Developer Community, v...@astrainfotech.com, svi...@astrainfotech.com, vinod...@gmail.com
Hi Pankaj

Thanks a lot for the quick solution. I was using getText directly just as you suspected

Regards

Vinod

Reply all
Reply to author
Forward
0 new messages