Hey yall im getting the above error when trying to execute the following for loop.
var prodLength = product.length;
for(let i = 0; i < prodLength; i++) {
if (product[i][5] > 0) {
if(quPn1.length <= 0) {
quPn1 = product[i][1];
} else if(quPn1.length >= 0) {
if(quPn2.length <= 0) {
quPn2 == product[i][1];
} else if(quPn2.length >= 0) {
if(quPn3.length <= 0) {
quPn3 == product[i][1]
}
}
}
} else if (product[i][5] <= 0) {
// code
}
};
product is a 2d array of variables refrenced to text fields eg.
const product = [
[caPn1,caDsc1,caWe1,caUp1,caVol1,caTot1]
[caPn2,caDsc2,caWe2,caUp2,caVol2,caTot2]
var caPn1 = String(this.getField("CaPn1").valueAsString);
var caPn2 = String(this.getField("CaPn2").valueAsString);
The end goal of the for loop is to loop through the 2d array checking for values greater than 1 in the fifth element of the interior array and if a value is seen to check a text field for text and if it is empty fill it with an element from the array. Thanks ahead of time for your help!