control.sumById()
- Last UpdatedJun 25, 2024
- 1 minute read
Use sumById() method to get the sum of the value of all controls with a specific ID on the form.
Syntax
// N1 is a Number object.
nRetVal = control.findById("N1").sumById();
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 ID.
var sum = control.findById("N1").sumById();
// Add all Number controls in the same and lower hierarchy on the form.
control.findById("N1").sumById("N1");
// Add all Number controls anywhere on the form.
control.findById("N1").sumById("N1",1);
// Add all Number controls in the same hierarchy on the form.
control.findById("N1").sumById("N1",2);