Hi,
The closest you will come to a function in Designer is a subformset with a "Select One Subform from Alternatives", then you can show a subform depending on an elements name in your data connection. So if you data connection looks like;
<Page1>
<Red>
<Row1>
<TextField1/>
<TextField2/>
<TextField3/>
<TextField4/>
</Row1>
</Red>
</Page1>
and you have one of the subforms in the set bound to Red and another bound to Green then changing the name of the element and call the remerge() method will show the other subform;
That is;
Page1.dataNode.nodes.item(0).name = "Green";
xfa.form.remerge();
Calling remerge can cause some problems as any changes to the properties of your form objects that are not bound will be reset to their initial values. Things like changing the border color, etc.
This might be best if the user can change values in the fields of both tables.
An alternative is to have some code in the Calculate event of a subform containing the two tables that keeps them in sync. This works well when one is a summary of the other, or a read-only version, otherwise you will need to put code in the exit event of each field in the second table to update the value in the field table.
Anyway here is a sample showing both approaches https://sites.google.com/site/livecycledesignercookbooks/home/subformset.pdf?attredirects=0&d=1.
I hope it helps
Bruce