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

Re: FormCalc formula question (find or select all of same named instance in different subforms)

Outlander00
Registered: Jan 10 2011
Posts: 9

I posted a question last week, and gkaiseril was very helpful!
 
I have come across an issue that I believe I know is due to my limited knowledge of LiveCycle and FormCalc: I am trying to have a text field in a table (ex. IStyle) calculating the .formattedValue of data from multiple, similarly named drop-down lists, each in different subforms (ex. MStyle). Ive tried a few different ways to have the field access and calculate the subforms that have the same named drop-down lists (for instance, the expressions ".." and "[*]" ), but have been unsuccessful.
  
Am I missing something in the logic, or is this something that needs JavaScript (such as the .resolveNode)? Thanks in advance!
 

My Product Information:
LiveCycle Designer, Windows
Outlander00
Registered: Jan 10 2011
Posts: 9
To add to my previous post, this is a most recent example (the calculating field name, which is in a table row, is "ISide"):

$.rawValue = null
if(Table2.Model[*].MSide.rawValue ne null)
then
$.rawValue = Table2.Model[*].MSide.formattedValue
else
$.rawValue = null
endif

I have tried to adapt what I learned from gkaiseril, and it works fine for the first subforms field; however, for the other instance of the field in other subforms, it does not work. I know I am doing something wrong with this, I just do not know what.
radzmar
Expert
Registered: Nov 3 2008
Posts: 1202
Hi,

can you please give us more details on you form structure?
It's not clear, how your table is designed (where are the fields IStyle and MStyle located exactly?).

You also can share a link to your form here, so we have acees to it.

radzmar
LoveCycle Blog
Documents you need:
LiveCycle Designer ES2 Docs

Outlander00
Registered: Jan 10 2011
Posts: 9
Actually, radzmar, I figured it out. It took you saying "not enough information" to chime something in me to going back to the basics. If the solution can be streamlined, I am all for it.

I renamed the subforms (with the same field I want to access) separately, then used "elseif" to differentiate.

example:

$.rawValue = null
if (Table2.Model100.MSide.rawValue ne null) then
$.rawValue = Table2.Model100.MSide.formattedValue

elseif (Table2.Model110.MSide.rawValue ne null) then
$.rawValue = Table2.Model110.MSide.formattedValue

elseif (Table2.Model120.MSide.rawValue ne null) then
$.rawValue = Table2.Model120.MSide.formattedValue

elseif (Table2.Model103.MSide.rawValue ne null) then
$.rawValue = Table2.Model103.MSide.formattedValue

elseif (Table2.ModelPVCIH.MSide.rawValue ne null) then
$.rawValue = Table2.ModelPVCIH.MSide.formattedValue

elseif (Table2.Model200.MSide.rawValue ne null) then
$.rawValue = Table2.Model200.MSide.formattedValue

elseif (Table2.ModelSL.MSide.rawValue ne null) then
$.rawValue = Table2.ModelSL.MSide.formattedValue

elseif (Table2.ModelHDSF.MSide.rawValue ne null) then
$.rawValue = Table2.ModelHDSF.MSide.formattedValue

else
$.rawValue = null
endif

Thanks for the help, radzmar!