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

Syntac Error: Missing ) in parenthetical

New Here ,
Feb 02, 2022 Feb 02, 2022

Copy link to clipboard

Copied

Trying to just create this simple formula, but it doesnt seem to be working. Thoughts? For context both the variables are calculated by adding other fields in the Adobe Form. 

(Head Count_Totals*0.5)-(Primary Workpoints_Totals*1)

TOPICS
Acrobat SDK and JavaScript , Windows

Views

1.1K

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 ,
Feb 02, 2022 Feb 02, 2022

Copy link to clipboard

Copied

For "Simplified Field Notation", the fields cannot contain spaces or punctuation. 

The solution is to rename the fields to remove all spaces and punctuation.

 

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

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 ,
Feb 02, 2022 Feb 02, 2022

Copy link to clipboard

Copied

Hey I removed all the spaces, but it still doesn't seem to be working. I'm almost wondering if its not recognizing the variables, idk...

 

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 ,
Feb 02, 2022 Feb 02, 2022

Copy link to clipboard

Copied

The names in the script must exactly match the names of the form fields. 

Are any errors reported in the Console Window?

 

 

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

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 ,
Feb 02, 2022 Feb 02, 2022

Copy link to clipboard

Copied

Also, the calculation you've shown will only work in the Simplified Field Notation  Calculation area. 

 

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

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 ,
Feb 02, 2022 Feb 02, 2022

Copy link to clipboard

Copied

Thanks for the reply. I'm still not getting it right somehow. I was wondering if you could tell me how this would be different if I did it in the Java script instead of the simple notation?

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 ,
Feb 02, 2022 Feb 02, 2022

Copy link to clipboard

Copied

What field names does you use?

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 ,
Feb 03, 2022 Feb 03, 2022

Copy link to clipboard

Copied

LATEST

You can read all about writing basic calculation scripts here:

https://www.pdfscripting.com/public/How-to-Write-a-Basic-PDF-Calculation-Script.cfm

 

You could also post your form so we can look at it. 

 

 

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

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 ,
Feb 02, 2022 Feb 02, 2022

Copy link to clipboard

Copied

Add a back-slash before each space in your fields' names, or use a script.

 

[Edited]

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