## Adobe Community

• Global community
• Language:
• Deutsch
• English
• EspaÃ±ol
• FranÃ§ais
• PortuguÃªs
• æ—¥æœ¬èªžã‚³ãƒŸãƒ¥ãƒ‹ãƒ†ã‚£
Dedicated community for Japanese speakers
• í•œêµ­ ì»¤ë®¤ë‹ˆí‹°
Dedicated community for Korean speakers
Exit
• IF Function with Less Than Values

# IF Function with Less Than Values

Community Beginner ,
Apr 30, 2019 Apr 30, 2019

Copy link to clipboard

Copied

How do you formulate an IF function where if the value of Field "C" is less than 70,000, then the value of Field "Tier 2" is not formulated?

Right now, this is what I have:

event.value = (70000-this.getField("C").value)*0.2;

if(C<70000)event.value,"Not Commissionable"

I know this isn't correct as I am not a professional with Javascript or Advanced Calculations, but I would like to know how to do this.

Thank you!

TOPICS
Acrobat SDK and JavaScript , Windows

Views

345

Report

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

## 1 Correct answer

Community Expert , Apr 30, 2019 Apr 30, 2019

Almost... Try this:

var C = Number(this.getField("C").valueAsString);

if (C<70000) event.value = "Not Commissionable";

else event.value = (70000-C)*0.2;

Votes

4 Replies 4
Community Expert ,
Apr 30, 2019 Apr 30, 2019

Copy link to clipboard

Copied

Almost... Try this:

var C = Number(this.getField("C").valueAsString);

if (C<70000) event.value = "Not Commissionable";

else event.value = (70000-C)*0.2;

Votes

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 Beginner ,
Apr 30, 2019 Apr 30, 2019

Copy link to clipboard

Copied

Even though the value "Not Commissionable" didn't populate (not your fault as I was just testing the software), thank you for your response! Your formula worked for what we needed it for!

Votes

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 Expert ,
Apr 30, 2019 Apr 30, 2019

Copy link to clipboard

Copied

Make sure you set the field's Format to None for it to work.

Votes

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 Beginner ,
Apr 30, 2019 Apr 30, 2019

Copy link to clipboard

Copied

LATEST

I changed "Not Commissionable" to "0" and it's formulating exactly how I need it to.

Thank you again for your help!

Votes

Report

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