Skip to main content
clarissah99296932
Participating Frequently
March 20, 2019
Answered

I need help with a code that will auto populate

  • March 20, 2019
  • 1 reply
  • 613 views

from another field if another field is zero. This would go after the code: event.value=Number(this.getField("EE Net Prem").valueAsString)/ Number(this.getField("multiplier").valueAsString);

This topic has been closed for replies.
Correct answer try67

Not sure what you're asking, but if you use this code you have to make sure that the value of "multiplier" is not zero first.

1 reply

try67
try67Correct answer
Braniac
March 20, 2019

Not sure what you're asking, but if you use this code you have to make sure that the value of "multiplier" is not zero first.

clarissah99296932
Participating Frequently
March 20, 2019

the multiplier is the commission base- so usually I use the net premium/multiplier (typically .85) to populate into the gross premium field. Not all groups have commission. I keep getting an error for "the value entered does not match the format of the field (EE Gross Prem)" when the multiplier is zero.

Is there another way I should write it so it will accept a number or zero?

try67
Braniac
March 20, 2019

Use this code:

var v1 = Number(this.getField("EE Net Prem").valueAsString);

var v2 = Number(this.getField("multiplier").valueAsString);

if (v2==0) event.value = "";

else event.value = v1/v2;