Expand my Community achievements bar.

Totaling all instances of subforms

Avatar

Former Community Member
I have an add button for an order form with the following on the click function

// Invoke the Instance Manager to add one instance of the order1 subform.



room._order1.addInstance(1);



//Invoke the recalculate method to include the field values from the added subform in calculations.



xfa.form.recalculate(1);



I need to total all of the added subforms

I have a separate numerical field with the following calculation being ran:

Sum (form1.#subform[0].Subform1.room.order1.Roomrate[*])



can someone tell me why this is still only calculating one instance of the subform?
5 Replies

Avatar

Former Community Member
Use the instanceManager count property:



SubForm.instanceManager.count



Chris

Adobe Enterprise Developer Support

Avatar

Former Community Member
how does this work to get the "total" within the subforms (I dont need to know how many times it appears I need the total $ amounts totalled (grand total))

Avatar

Former Community Member
My bad. I read that wrong. Off the top of my head I think it should be:



Sum(form1.#subform[0].Subform1.room.order1.Roomrate[*].rawValue)



Chris

Adobe Enteprise Developer Support

Avatar

Former Community Member
Chris:

I have posted a message several times for another unrelated issue, but I have not received a response could you possibly help me?



I had to e-mail the form I have been working on to the end user, when she tried to open it it told her that the file had been damaged and could not be recovered. Do you know why? Could it be the version of adobe she is working with?

Any help would be appreciated

Avatar

Former Community Member
Usually if it's a problem with an old version it will tell you the PDF version is newer and things will not work. For the most part Acrobat/Reader ignores things in the PDF that it doesn't understand (ie: new functionality added in a new PDF version). If it says it's been damaged that usually means some absolutely essential section has been changed somehow. But if she emails it back to you, can you open it?



I've seen problem when emailing PDF's using some of the web based email services. Most of them have virus checking automatically done on attachments and some of those checkers actually modify the bytes slightly and that can cause problems.



While a PDF is a binary file, a lot of it is in plain text. If she opens in it in a text editor she should be able to determine if it at least looks like a PDF or if it's just complete garbage. If it's complete garbarge then something went wrong on transit. If it looks somewhat like a PDF, then I'm not sure, but try resending it and make sure no virus checker is in the way that may cause problems.



Chris

Adobe Enterprise Developer Support