Hi,
I have created a Decimal field on a layout. I then have two other Decimal fields that are getting populated from the system. I want to try and subtract these two fields. I have been trying JavaScript and Formcalc, but cannot get it to work. It seems like it should be something easy to do. I would like to put this calculation on the "calculate" event.
First Field -> data.Page1.Position.ITEMS.TOTAL[0]
Field Subtracted from First -> data.Page1.Position.ITEMS.SALE
Calculation field -> data.Page1.Position.ITEMS.NEW
Any ideas how this can be done, or if it can?
Then I would like to hide the field if the calculated value comes back as zero, or empty. So I was going to try on the "initialize" event to add,
var new = data.Page1.Position.ITEMS.NEW.rawValue;
if (new == null || new == "" || '0')
{
data.Page1.Position.ITEMS.NEW.presence = "hidden";
}
Any advice would be appreciated.