Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

FormCalc error using count in a dynamic form with repeat row min set to 0

Level 1
Level 1


I am generating a flowed table with 2 aggregation levels using a XML data binding. 1st level INCOMES_TAXED, 2nd level DETAILS

The following formula works nicely as long as there is a minimum of 1 RowDetail displayed.




When the XML data file has no DETAILS for IMCOMES_TAXED, no RowDetail are displayed in the table and then I get the following error:

accessor $record.INCOMES_TAXED.INCOME_TAXED[*].DETAILS.DETAIL[*].TAX_CHF is unknown.

Strangely, this error doesn't happen when no INCOMES_TAXED elements are in the XML file.

This can be easily solved by setting the repeat row min to 1, but it generates unecessary blank lines.

Is there a better way to check if either the RowDetail exists or if DETAILS elements are in the XML.


3 Replies
Level 10
Level 10

When a Row can be set to 0 instance, the only way to access that row is to use the underscore "_Row1" which access directly to the instanceManager of the object.

It is bypassing through the object Row1 because it doesnt exist in that  case, it's the only way to work around with the object...

you absolutely need 1 instance to be able to work with it...

Hope this help

Level 1
Level 1

I made some tests using "_RowDetail" (as I am interested in testing the second level) but I didn't succeed with a 2 level Table as:


It is why I tried to use the count on the XML structure that is bind on it, hoping to be able to check if there is a TAX_CHF element in: "$record.INCOMES_TAXED.INCOME_TAXED[*].DETAILS.DETAIL[*].TAX_CHF. But this is when I get the error accessor $record.INCOMES_TAXED.INCOME_TAXED[*].DETAILS.DETAIL[*].TAX_CHF is unknown".

Level 1
Level 1

I solved the problem using resolveNodes

var I=form1.INCOMES_TAXED.DATA.resolveNodes("Row1[*].DATA.RowDetail[*].AMT_CHF").length

if (I > 0) then