You are viewing limited content. For full access, please sign in.

Question

Question

Unable to find field. Please check your ID. New Forms Designer

asked two days ago

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 });

 

0 0

Replies

replied two days ago

Hi David, which version of Forms are you using?

1 0
replied two days ago

Just an update on this for anybody experiencing similar issues.

I ended up changing my lookup to a stored procedure as it seems the form kept trying to populate the table based on my views where clause which caused a lot of abnormalities.

Sometimes the table would be populated correctly, and other times the first row would quickly populate and then get overridden with blank values.

This cause additional rows to be added.

By changing the view to a stored procedure I force the lookup to wait for all required values before executing, which seems to have resolved my issue.

I am still not certain why the code would not work once additional rows were added though.

You are not allowed to follow up in this post.

Sign in to reply to this post.