Hey there ive got a code to conditionally populate text fields with the values of other text fields and i can get the info i want in console but cant get it into the text fields for some reason the closest ive gotten so far is null printed where i want the data can anyone help me out?
var pageDictionary = [
"Ca",
"Pu",
"Sc",
"St",
"Ts",
"Wh",
];
var fieldDictionary = [
"Pn",
"Dsc",
"We",
"Up",
"Vol",
"Tot",
];
var lineDictionary = {
"Ca": 6,
"Pu": 6,
"Sc": 6,
"St": 6,
"Ts": 6,
"Wh": 6,
}
var linesInFinalQuote = 0;
var i = 0; //Primary Itteration
var it = 0; //Secondary Itteration
for( i = 0; i < pageDictionary.length; i++)
{
// Itteration through pages
for(it = 0; it < lineDictionary[pageDictionary[i]]; it++)
{
// Itteration through each line on the page
var itemVolume = String(this.getField(pageDictionary[i] + "Vol" + it).valueAsString);
// Goes through each line as gets the volume of the line
if(itemVolume > 0)
// Add to final page
linesInFinalQuote += 1;
// For loop to add this line to final page
for(var j = 0; j < fieldDictionary.length; j++)
{
(this.getField("Qu"+String(fieldDictionary[j])+String(linesInFinalQuote)).value = this.getField((pageDictionary[i] + fieldDictionary[j] + String(it)).value));
}
}
}
/* page + field + linenumber
pagefieldlinenumber
page + string(field) + string(linenumber);