Assuming you want to assign the result of this calculation to another text field, use this code as that field's custom calculation script:
var o = this.getField("o").valueAsString; var o8 = this.getField("o8").valueAsString; var a = this.getField("a").valueAsString; if (o!="" && o8!="" && a!="") event.value = (Number(o)-Number(o8))*Number(a); else event.value = "";
Thank you Mr. Try67 you are the man, that worked great and i was able to adjust it for all of my other formulas. if you have time please explain the code so i can understand the script. as right now im just changing the text field name but completely understanding the script.
It's pretty simple, really. Lines 1-3 collect the values of the fields to variables. Line 4 checks whether all the variables are not empty, and if that's the case performs the calculation and applies it to the field using the "event.value" property.
Line 5 is for the scenario where one (or more) of the values is empty, in which case it applies an empty string as the field's new value.