• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

I need help with a code that will auto populate

New Here ,
Mar 20, 2019 Mar 20, 2019

Copy link to clipboard

Copied

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);

TOPICS
Acrobat SDK and JavaScript , Windows

Views

328

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Mar 20, 2019 Mar 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.

Votes

Translate

Translate
Community Expert ,
Mar 20, 2019 Mar 20, 2019

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 20, 2019 Mar 20, 2019

Copy link to clipboard

Copied

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?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 20, 2019 Mar 20, 2019

Copy link to clipboard

Copied

LATEST

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;

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines