control.sumByName()
- Last UpdatedJun 25, 2024
- 1 minute read
Use sumByName() method to get the sum of the value of all controls with a specific name on the form.
Syntax
// N1 is a Number object.
nRetVal = control.findById("N1").sumByName();
Parameters
None.
Return Value
This method returns a numeric value.
Example
// Define a variable and get the sum of the value of all controls with a specific name.
var sum = control.findByName("Amount").sumByName();
// Add all Number controls in the same and lower hierarchy on the form.
control.findById("N1").sumByName("Amount");
// Add all Number controls anywhere on the form.
control.findById("N1").sumByName("Amount",1);
// Add all Number controls in the same hierarchy on the form.
control.findById("N1").sumByName("Amount",2);