0
Script Example - Summing Values In a Grid (version 23)
Knowledge Base / Version 23 / Client Tools / Axiom / Applications
As of version 22.2, the following code snippet is no longer needed if wishing to create simple calculations as it can be accomplished using the U/I. See How to Build Ad Hoc Calculations.
The following code snippet demonstrates how to add 3 values together and display the sum in a 4th value box. The controls do not necessarily need to be values boxes, but could include donut gauges, linear gauges, and circular gauges. For this example, the controls MUST all reside in the same row of a grid as the grid row is a "parent" container of the value boxes.
To edit the script...
- Select the first ValueBox then select the script icon within the 'OnEndValueChange' property. (Note: You must have admin permissions in order to edit the script of an Axiom application.)
- Copy/Paste the code snippet into the script then click 'APPLY & CLOSE'.
- Select the 2nd and 3rd ValueBox and link them to this same function by selecting the 'ValueBox1_OnEndValueChange' from the drop-down list.
This script will run anytime any one of the 3 ValueBoxes receives a new value and updates the 4th ValueBox.