Calculate the Tax based on the sum of two other boxes

Community Beginner ,
May 09, 2018

Copy link to clipboard

Copied

I need a formula to add two boxes (subtotal and other charges) and then times that by the tax rate (which will be input at the point of sale). Can anyone else me write this equation? I am happy to email you my pdf or really anything to get this last step completed. --Thank you!

Ok, you named at least one of your field wrong.  It is "OtherCharges", not "Othercharges".  JS is case sensitive.

TOPICS
Acrobat SDK and JavaScript

Views

156

Likes

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

Calculate the Tax based on the sum of two other boxes

Community Beginner ,
May 09, 2018

Copy link to clipboard

Copied

I need a formula to add two boxes (subtotal and other charges) and then times that by the tax rate (which will be input at the point of sale). Can anyone else me write this equation? I am happy to email you my pdf or really anything to get this last step completed. --Thank you!

Ok, you named at least one of your field wrong.  It is "OtherCharges", not "Othercharges".  JS is case sensitive.

TOPICS
Acrobat SDK and JavaScript

Views

157

Likes

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
May 09, 2018 0
Most Valuable Participant ,
May 09, 2018

Copy link to clipboard

Copied

What's the format of the tax rate field? What are the names of the fields involved?

Likes

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
Reply
Loading...
May 09, 2018 0
Community Beginner ,
May 09, 2018

Copy link to clipboard

Copied

I need to sum the "costsubtotal" and "Othercharges" these fields are categorized by number . The tax field is formatted by Percentage, this field is "Taxrate".

Thank you!!!!

Likes

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
Reply
Loading...
May 09, 2018 0
Most Valuable Participant ,
May 09, 2018

Copy link to clipboard

Copied

Under the Calculate tab of the field where you want the result to appear, in the Simple Field Notation section, enter:

(costsubtotal + Othercharges) * Taxrate

Likes

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
Reply
Loading...
May 09, 2018 0
Community Beginner ,
May 09, 2018

Copy link to clipboard

Copied

So I plugged this in, and the amount isn't showing up. Shouldn't it auto fill?

Likes

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
Reply
Loading...
May 09, 2018 0
Most Valuable Participant ,
May 10, 2018

Copy link to clipboard

Copied

Yes. Did you change the value of one of the fields, though?

Likes

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
Reply
Loading...
May 10, 2018 0
Community Beginner ,
May 10, 2018

Copy link to clipboard

Copied

Yes, I have tried a bunch of different changes, and the CostTaxRate box isn't changing. It is blank.

Likes

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
Reply
Loading...
May 10, 2018 0
Engaged ,
May 10, 2018

Copy link to clipboard

Copied

Can you share the file?  because this is quite a simple task.  There is no reason it should not work.  Did you copY/pasted the name of your fields in the thread to make sure there is no typos?

Likes

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
Reply
Loading...
May 10, 2018 0
Community Beginner ,
May 10, 2018

Copy link to clipboard

Copied

I am happy to share. I agree that this should be simple, and I just perplexed as to what I am doing wrong. I don't see a upload a document link on here, do we need to use email?

Likes

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
Reply
Loading...
May 10, 2018 0
Engaged ,
May 10, 2018

Copy link to clipboard

Copied

You can share it throught a google drive link?

Likes

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
Reply
Loading...
May 10, 2018 0
Community Beginner ,
May 10, 2018

Copy link to clipboard

Copied

Here I think this should work.

Invoice 2 - Copy.pdf - Google Drive

Likes

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
Reply
Loading...
May 10, 2018 0
Engaged ,
May 10, 2018

Copy link to clipboard

Copied

Ok, you named at least one of your field wrong.  It is "OtherCharges", not "Othercharges".  JS is case sensitive.

Likes

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
Reply
Loading...
May 10, 2018 0
Community Beginner ,
May 10, 2018

Copy link to clipboard

Copied

Wow all that because of a c/C. Thank you for all your help, it is so greatly appreciated.

Likes

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
Reply
Loading...
May 10, 2018 1
MatLac LATEST
Engaged ,
May 10, 2018

Copy link to clipboard

Copied

This is 90% of errors encountered when facing a simple task.  Always copy/paste field names and variables whenever possible avoid errors.  Sadly (but sometimes helpfully) JS stops as soon as an exception is thrown.  this sometimes helps identify at what place the exception was thrown.

Also, activate the console in case of error.  You can find this option in edition/preference/javascript.  When an error says it can't find a field, it's beacause the name is wrong.

Likes

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
Reply
Loading...
May 10, 2018 1