Hoping someone can help me here.
I have a form which adds rows to a table based on a lookup.
The table contains a check box with one option in it "Yes".
Outside of the table I have another check box, also with one option "Yes"
The idea is that when the user select the outer check box, that all check boxes within the table should also be selected.
However this does not work as I keep getting an error in the console of "Unable to find field. Please check your ID."
At first I though I was selecting the incorrect field id, however when I change the setting on the table to have a minimum number of rows of "1" the code marks the check box for this one row, but not the new rows added by the lookup.
I also do not get an error in the console.
When I change the table configuration to populate the table with rows from the lookup, the error comes up again, and the check boxes are not being checked by the code.
I also tried using the variable name, but this gave me the same result.
function selectAllCheck () { let selectOption = LFForm.getFieldValues({ variableName: "Select_All" }); console.log("selectOption: ",selectOption) let selectoptionVal = selectOption.value[0] if(selectoptionVal === 'Yes') { LFForm.setFieldValues({fieldId: 29}, {value: ["Yes"]}) } else { LFForm.setFieldValues({fieldId: 29}, {value: [""]}) }; }; //listen for changes to fields LFForm.onFieldChange(selectAllCheck, { fieldId: 28 });