onAddRecord - event of the PmaTrendGroup object
The event is triggered on the request for saving the values (in the form of new record), but before the saving is done. This event can be used for preparing the data to be saved.
|pMe||(Object) Reference to the PmaTrendGroup object where the event rises.|
|pEvent||(Object) Reference to object describing detailed information about the specific event. |
The pEvent parameter is not used here because this event does not need any additional information.
Convert trend unit before saving. (The value is obtained via the data extension ExtTrend
of the PmaData
var oPressure = pMe.Pm("../Data/#vars/pressure");
oPressure.Value = oPressure.Value / 100; //150 kPa / 100 = 1.5 bar