These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Getting saved form to not recalculate when opened again

eleckband
Registered: Jun 1 2009
Posts: 10

I am a novice to creating forms but I created a form that when the percent of reduction and price are entered the form will calculate the reductions either for an 8 week or 12 week period. It works great except that when you go to reopen the form after saving it does the calculations again and the numbers are changed from the saved original.

I have spent many hours trying to figure it out but haven't come upon anything that works, please any guidance would be greatly appreciated.

Thank you.

My Product Information:
LiveCycle Designer, Windows
radzmar
Expert
Registered: Nov 3 2008
Posts: 1202
You can use an if-statement for your calculation.

//this is JavaScriptif (this.rawValue == null){your code for the calculation}else{}

or

//this is FormCalcif ($.rawValue == null) thenyour code for the calculationelseif$.rawValueendif

radzmar
LoveCycle Blog
Documents you need:
LiveCycle Designer ES2 Docs

eleckband
Registered: Jun 1 2009
Posts: 10
I am not quite sure how to implement. Here is the code and how I implemented. I get an error message when I check in preview mode.

Thank you!

----- topmostSubform.Page1.ten_day::calculate: - (FormCalc, client) --------------------------------

//this is FormCalc
if ($.rawValue == null) then
Sum(list_price[0] - list_price[0] * percent_adjustment[0]/100, (Round(ten_day[0])))
elseif
$.rawValue
endif
radzmar
Expert
Registered: Nov 3 2008
Posts: 1202
What error message?

radzmar
LoveCycle Blog
Documents you need:
LiveCycle Designer ES2 Docs

eleckband
Registered: Jun 1 2009
Posts: 10
It says:
Script failed (language is formcalc; context is xfa[0].topmostSubform[0].Page1[0].ten_day[0])
script=//this is FormCalc
if ($.rawValue==null)then
Sum(list_price[0] - list_price[0] * percent_adjustment[0]/100, (Round(ten_day[0])))
elseif
$.rawValue
endif
Error: syntax error near token'$' on line 5, column 1.
radzmar
Expert
Registered: Nov 3 2008
Posts: 1202
And with this one?

if ($.rawValue == null) then
$.rawValue = Sum(list_price[0] - list_price[0] * percent_adjustment[0]/100, (Round(ten_day[0])))
elseif
$.rawValue = $.rawValue
endif

radzmar
LoveCycle Blog
Documents you need:
LiveCycle Designer ES2 Docs

eleckband
Registered: Jun 1 2009
Posts: 10
It still throws up an error message when tested.

Script failed (language is formcalc; context is xfa[0].topmostSubform[0].Page1[0].ten_day[0])
script=//this is FormCalc
if ($.rawValue==null)then
$.rawValue=Sum(list_price[0] - list_price[0] * percent_adjustment[0]/100, (Round(ten_day[0])))
elseif
$.rawValue=$.rawValue
endif
Error: syntax error near token'$' on line 5, column 1.

I really appreciate the help with this.
Thanks,
~E
radzmar
Expert
Registered: Nov 3 2008
Posts: 1202
Hmm, can you upload the form so I can have a look on it?

radzmar
LoveCycle Blog
Documents you need:
LiveCycle Designer ES2 Docs

eleckband
Registered: Jun 1 2009
Posts: 10
I can't seem to figure out how to attach to a post. Please advise.
Thank you,
~E