Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.
SOLVED

Script failed -formcalc

Avatar

Level 4

Hello,

I'm very new to LiveCycle Designer, and I'm getting the error message: "Script failed (language is formcalc; context is xfa....Error:syntax error near token '(' on line 3 column 0.

I'm simply adding some numeric fields together. The calculation works fine but I want to get rid of this error message-any ideas?

Here is the code that I have in the Script Editor:

form1.Page2.TotalEnrollment::calculate - (FormCalc, client)

TotalEnrollment.rawValue = NumericField1.rawValue + NumericField2.rawValue

This doesn't make any sense-I don't even have a "(" in my syntax....

Thanks!

1 Accepted Solution

Avatar

Correct answer by
Level 10

Hi,

With FormCalc you do not need .rawValue.

Also as the script is in the object that you want to set the value of, you can use $ instead of the object name.

Try:

$ = NumericField1 + NumericField2

Check that you don't have an error elsewhere, as I suspect that this may be the problem.

Niall

View solution in original post

2 Replies

Avatar

Correct answer by
Level 10

Hi,

With FormCalc you do not need .rawValue.

Also as the script is in the object that you want to set the value of, you can use $ instead of the object name.

Try:

$ = NumericField1 + NumericField2

Check that you don't have an error elsewhere, as I suspect that this may be the problem.

Niall

Avatar

Level 4

It turns out there was an incomplete string of code above what I posted. "sum(" from where I was experimenting earlier.  Thanks for the info-it'll save me some time.