Expand my Community achievements bar.

SOLVED

FormCalc

Avatar

Level 2

Hello,

I have created a form that contains a table that currently has one row and several columns. To add additional rows/columns the user would click an "Add Additional Rows" button.  . One column of the table name "FeeDue" would be used for numeric values.  Those numbers would be added together in the "Total" column.  When numbers are enetered in a  column named "Ramount" those numbesr would be subtracted from the "Total".

Everything works with one exception --  The number add correctly, the first subtraction works correctly, but when I add a new row the subtraction in that and any following rows do not..

Also, is there anyway to get the numeric values from a drop down list to add?  When I try to do so,  I get a number 1 or 2, and not the actual number. 

This is the script.

---------------------------form1.DV.Subform2.Total::calculate: - (FormCalc, client)-------------------------------------


sum(Table1.Row2[*].FeeDue[*]) - (Table1.Row2[*].Ramount[*])

-------------------------------------

Also, is there anyway to get the numeric values from a drop down list to add?  When I try to do so,  I get a number 1 or 2, and not the actual number.

Thank you

1 Accepted Solution

Avatar

Correct answer by
Former Community Member

The form is on its way.

I modified the names of the row in the table Subform2.Total. I changed Row1 to Header and Row2 to Row because it helps me understand the structure of the table easier.
The problem is in your calculate event for the Total. You need to sum each column before you subtract. I changed it from...
// form1.DV.Subform2.Total::calculate - (FormCalc, client)
sum(Table1.Row2[*].FeeDue[*]) - (Table1.Row2[*].Ramount[*])
to...
// form1.DV.Subform2.Total::calculate - (FormCalc, client)
sum(Table1.Row[*].FeeDue[*]) - sum(Table1.Row[*].Ramount[*])
Steve

View solution in original post

6 Replies

Avatar

Former Community Member

I am not sure what may be going on without seeing the form. I put together the attached which has drop-downs for numerics values and does subtraction.

Untitled.png

Steve

Avatar

Level 2

Thank you so much for responding.

Please see attached - the form. From the header AMOUNT should calculate in Row 2 and REASON CHECK RETURNED Amount should subtract from the Total.

Date: Wed, 21 Jul 2010 09:01:04 -0600

From: forums@adobe.com

To: theolar@hotmail.com

Subject: FormCalc

I am not sure what may be going on without seeing the form. I put together the attached which has drop-downs for numerics values and does subtraction.

http://forums.adobe.com/servlet/JiveServlet/showImage/34841/Untitled.png

Steve

>

Avatar

Former Community Member

The attachment didn't make it. Alternatively you can send it to stwalker.adobe@gmail.com.

Avatar

Level 2

The attachment does not open for me.

Date: Wed, 21 Jul 2010 09:01:04 -0600

From: forums@adobe.com

To: theolar@hotmail.com

Subject: FormCalc

I am not sure what may be going on without seeing the form. I put together the attached which has drop-downs for numerics values and does subtraction.

http://forums.adobe.com/servlet/JiveServlet/showImage/34841/Untitled.png

Steve

>

Avatar

Correct answer by
Former Community Member

The form is on its way.

I modified the names of the row in the table Subform2.Total. I changed Row1 to Header and Row2 to Row because it helps me understand the structure of the table easier.
The problem is in your calculate event for the Total. You need to sum each column before you subtract. I changed it from...
// form1.DV.Subform2.Total::calculate - (FormCalc, client)
sum(Table1.Row2[*].FeeDue[*]) - (Table1.Row2[*].Ramount[*])
to...
// form1.DV.Subform2.Total::calculate - (FormCalc, client)
sum(Table1.Row[*].FeeDue[*]) - sum(Table1.Row[*].Ramount[*])
Steve

Avatar

Level 2

Thank you.

This takes care of the problem.

The following has evaluated to null or missing: ==> liqladmin("SELECT id, value FROM metrics WHERE id = 'net_accepted_solutions' and user.id = '${acceptedAnswer.author.id}'").data.items [in template "analytics-container" at line 83, column 41] ---- Tip: It's the step after the last dot that caused this error, not those before it. ---- Tip: If the failing expression is known to be legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)?? ---- ---- FTL stack trace ("~" means nesting-related): - Failed at: #assign answerAuthorNetSolutions = li... [in template "analytics-container" at line 83, column 5] ----