Hey again,
Well I almost have this working but I am just missing something and can't figure out what it is.
Here is my problem!
I have 5 fields that I am trying to get to do calculations between.
First is a field called A. The settings for this field are set to Number and is manually entered. (this is for square feet).
Second field is called AP (for adjusted percentage) and settins is set to number with decimal point at 2 and vaule is set to 0. (this is for manually entering in a discount percentage ie .10)
Third field is called B (for sales price) that is also manually entered. Settings for this field are set to number.
Fourth field is called ASP1 (for adjusted sales price) Settings for this field are set to number and custom calculation script is:
// total purchase
var a = this.getField("B").value;
// discount rate of total purchase
var b = this.getField("AP").value;
// compute discount amount
var fDiscount = a * b;
// compute total puchase less discount, net purchase price
event.value = a - fDiscount;
The fifth field is called D (for Price per square foot) The settings for this field are set to number and the custom calculation script is:
// clear the field or other action as needed
event.value = '';
var dASP1 = this.getField('ASP1').value;
var dA = this.getField('A').value;
// make sure divisor is not zero or not a number and dividend is not a number
if( dA != 0 & !(isNaN(dA)) ) {
// perform the division
event.value = dASP1 / dA;
}
Ok when you manually enter in square foot number in A and also enter in a sales price in B it should give me the adjusted sales price in ASP1 and a price per square foot in D. If I change any of the nimbers it should re do the correct calculation.
Everything works fine but field D (price per square foot) It keeps coming up with the wrong number.
I have looked and looked and can't seem to find what it is that I am missing.
Can you see what it is that I am missing?
Bill
If the result is the expected result for the most recent prior values, then your field calculation order is wrong.
George Kaiser