Skip to content Skip to footer

Calculate Subform Fields

The below form script calculate the textfields values from the subform


 result_4 = 0;
 val_cal = [{'a':"Textbox_21"}, {'a':"Textbox_22"}]
 
function on_submit(ws){
  for(var i=0; i < val_cal.length; i++){
    var val = val_cal[i];
    var val_identifier = val['a'];
    var value = JSON.parse(ws.getWidgetValue(val_identifier));
    calculation(ws, value)
  }
}

function calculation(ws, value){
  result_4 = result_4+value;
  ws.setWidgetValue("result", result_4);
  ws.reloadUICell("result");
  
}

In the above script, We have taken textfields identifier in a list that needs to be calculated. This will work on asset and action forms.

Was This Article Helpful?

0
0 Comments

There are no comments yet

Leave a comment

Your email address will not be published. Required fields are marked *

Close Bitnami banner
Bitnami