I am trying to create a basic IF THEN statement using LiveCycle 8 with a form that was orginally a PDF file.
I have two columns that lists these items:
The 1st Column:
Total Income:
Total Expenses:
Surplus:
The 2nd column
Total Income:
Total Expenses:
Deficit:
For both columns the Total Income and the Total Expenses are pulled from other fields and populate. What I want to happen is if the Total Income is less than the Total Expenses then the number would appear in the "Deficit" field, if the Total Income is more than the Total Expenses it would appear in the Surplus field. I tried to create a basic IF THEN statement and I received this error message:
Script failed(language is formcalc; context is xfa[0].form[0].topmostSubform[0].Page3[0].Surplus[0]) script=if (TMI > TotalMonthlyExpense) then . Error: syntax error near token '.' on line 1, column 39 Script failed (language is formcalc; context is xfa[0].form[0]topmostSubform[0].Page3[0].Surplus[0]) script=if (TMI > TotalMonthlyExpense) thenvalue = (TMI-TotalMonthlyExpenses) Error: syntax error near token ')' on line 1 column 70.
This was the calcuation script I used that generated that error:
if(TMI > TotalMonthlyExpense)then value = (TMI - TotalMonthlyExpenses)
From this can anyone tell what I am doing wrong? Thanks in advance for your help. Hope this made sense!
in FormCalc you need to terminate the if expresssion with the "endif" tag.
Also, you better don't use variable names like "value", because those are reserve for other things.
radzmar
• LoveCycle Blog
Documents you need:
• LiveCycle Designer ES2 Docs