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

FormCalc won't calc!

R_Boyd
Registered: Nov 1 2007
Posts: 151

I have created a subform with repeating rows and I'm trying to have a calculated field keep track of the cumulative mileage.

The structure is

form1
sectionB
header
detail
button1
date_from
date_to
mileage
delete
total
total

In total I have amended the script from the Purchase Order template but I must be doing something wrong as it isn't working. I have applied the script below to the calculate event on the total field.

//Verify at least one instance of the mileage field exists.
 
if (exists(details[0].mileage) == 1) then
  Sum(detail[*].mileage)
endif

Any ideas?

My Product Information:
LiveCycle Designer, Windows
gkaiseril
Expert
Registered: Feb 23 2006
Posts: 4308
The Scripting Refernece list "Exist()" as the function. Try:

if (Exists(details[0].mileage) == 1) then
Sum(detail[*].mileage)
endif

FormCalc and JavaScript is case sensative for keywors, variables, functions, properites, methods, etc.

George Kaiser