Expand my Community achievements bar.

Instance Count

Avatar

Not applicable
I want to have a field visible to the user that indicates which instance of the subform they are looking at. For example, in my form adding an instance is in fact adding an item to a policy. If it is the first instance added I want the ITEM# field to show "1". When they click "add item" additional times I want the next ITEM# to be 2 while the first subform ITEM# remains 1. Pretty much I want to utilize the [*] instance count as a visible item count for the user. How do I do this?
0 Replies

Avatar

Not applicable
You can get the instance number on an object in the subform by using this.parent.index Remeber that instance numbers are 0 based.

Avatar

Not applicable
Ok, I'll give that a try. I understand they are "0" based, couldn't I just add one to the return from this.parent.index to get an accurate number for my purposes?

Avatar

Not applicable
you can set the rawdata of the "count field" to



xfa.form.form1.formPage.mainSub.table.instanceManager.count



which will give you the current row #.



hope this helps

Avatar

Not applicable
Hi,

Paul's answer is correct. You can use parent's index property. instanceManager.count will give the latest count of instances of row. But wont show the instance index of current row.

So this.parent.index + 1 is the solution.



Asiye

Avatar

Not applicable
this.parent.index +1 is working perfectly! Thank you so much!