Ask questions about installing and configuring ProcessMaker 3

Moderator: amosbatto

By walshie1973
We are running Processmaker and I have been trying to do a calculation of a grid field called Total (see below)
RecruitmentTests01.png (20.39 KiB) Viewed 846 times
If the "Required" field is checked, then the total should equal the cost field. If it is unchecked, then the amount should be 0.00. I would then like to use the sum of the "Total" field in other calculations on the Dynaform.

I have tried so many different ways of coding this, which haven't worked, so it would be pointless to even show any of it here.

Any suggestions how to do this in version 3.0?
By Vvladimir
Hi walsh 1973

Let you know that there is an option in Grids for the same Dynaform, you of the total according to the fields that you enter it, you attached a picture, hope I helped.


Best Regards,

Vladimir Vargas
Software Quality Engineer
(72.63 KiB) Downloaded 12 times
By cpomares
Hi walshie1973,
As far as i understand, you want something similar to this:
Selection_004.png (20.23 KiB) Viewed 296 times
You can do it using JavaScript, here i show you the code i used:
Code: Select all
var sum =0;
for (var i=1;i<=$("#gridVar002").getNumberRows();i++){
	if($("#gridVar002").getValue(i,2) == "1"){

Where "gridVar002" is the ID of the grid and "textVar002" is the ID of the final text box where i display the sum of the total.

By PipSqueak
Hi, I added setonchange, but this did not work.
Code: Select all
$("#form").setOnchange(function(field, newVal, oldVal) {  
var sum =0;
for (var i=1;i<=$("#gridQuotes").getNumberRows();i++){
	if($("#gridQuotes").getValue == "1"){

By amosbatto
You need to use the ID of the Dynaform, like this:
Code: Select all
var formId = $("form").prop("id");
$("#"+formId).setOnchange(function(field, newVal, oldVal) {  
  var sum = 0;
  for (var i = 1; i <= $("#gridQuotes").getNumberRows(); i++) {
    if ($("#gridQuotes").getValue == "1") {
      	$("#gridQuotes").setValue( (parseFloat($("#gridQuotes").getValue(i,2))), i, 5);
    sum = sum + $("#gridQuotes").getValue(i,5);

  $("#textVar002").setValue( parseFloat(sum) );
Jalali Calendar

This topic says that this function " jdate fu[…]


I just tried it in PM 3.2.1 and executing cron.p[…]

Session Expiration Issue

Hi .. I am using Mobile User Experience. In thi[…]

What happens if you change your HTML code to this?[…]