Calculations in template with renamed fields?
I have a form with two templates that are spawned as necessary (user generated) the first is named "tpt_Soil" and the second is "tpt_Veg". The entire form (with no additional pages added) is 11 pages. Sometimes the user will need additional copies of "tpt_Soil", sometimes not. Same with "tpt_Veg". Copies of the second one could start on page 12, but it also could start on page 15 or 16, depending on the scenario.
"tpt_Soil" has no calculations, so my button action javascript works no problem:
var SoilPage = this.getTemplate("tpt_Soil");
SoilPage.spawn(this.numPages, true, false)
However, "tpt_Veg" is more complicated, it is two pages long AND has a number of calculated fields. How do I rewrite the scripts for those fields so that they will still work in the spawned (and renamed) templates?
So for example on tpt_Veg there are fields named: F1a.Strata.Canopy, F1a.Strata.SubCanopy, F1a.Strata.Shrub, F1a.Strata.Herb and then F1a.Strata_Total which is the sum of the F1a.Strata fields.
Right now that's done through the pick-list calculations, but obviously won't work when the fields are renamed Pxx.F1a.Strata because I don't know what page they will end up as.