Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

Problems with Sum FormCalc Function

Avatar

Level 2

I am trying to get several fields to add together and appear in a total field.  I have used this feature on other forms without issue but now I am having two seperate options on the same form.

First, I am getting getting accessor is unknown error when I go to Preview the pdf.

Second, in another group of fields, I enter amounts and nothing appears in the total field.  I know it has been setup as calculation only but nothing is showing up and the field is no longer blue either.

Has anyone else experienced his or know what the issue is?

7 Replies

Avatar

Level 10

What does the script look like you use to calculate the total?

Avatar

Level 2

The one I am having the accessor error is "Sum (empIncome, investIncome, pensionSSN, otherSource)"  The accessor error is showing up for the first one, empIncome.

The one I am having an issue with sum showing up is "Sum (bondsAmt, certofDep, commoditiesAmt, exchangeTraded, fixedAnnuity, marginTrading, mutualFunds, optionsAmt, partnershipsAmt, realEstate, stocksAmt, variableAnnuities, variableAmt, otherAmt)"

Avatar

Level 10

Sounds like the reference syntax to the field in not correct, but this is hard to determine without the form.

Can you share it, so I can take a look onto it?

Avatar

Level 2

Unfortunately, I cannot.  I work for a financial services company and the form has not been approved by the SEC yet so I cannot post it anywhere.

Are you looking for this:  form1.#subform[15].#area[7].Table3[3].Row1.empIncome::calculate - (FormCalc, client)

Avatar

Level 2

Could it have anything to do with the fields being inside a table?  I took the numerical fields out and the calculation worked fine.


Avatar

Level 10

Sure,

if the total field is placed somewhere outside the table or in antother row, the reference syntax needs to be more precisely.

You can use the script editor to determine the full SOM expression to your fields.

When you place the text cursor into the script editor, then press and hold ctrl + shift, then move the mouse over the target field (a v should appear) and press the mouse button, the script editor will be populated with the full SOM expression.

Avatar

Level 2

Okay, I did as you instructed and the additional part of the expression is added but I still receive the same error.  Do I need to delete the first line of the code or does this supplement it?