Hi all,
I've come across this issue in Modern Forms in Laserfiche Forms 11 Update 5. I have a table, with a variable called "Customer", with at least one row added. I want to add a new customer to the dropdown with a variable I defined as fullName. I'm able to get the form to add fullName to the dropdown list if I use fieldId, but not variableName.
I am able to use variableName when getting values from the single-line text boxes First_Name and Last_Name, however.
var fullName = LFForm.getFieldValues( { variableName: "Last_Name" } ) + ", " + LFForm.getFieldValues( { variableName: "First_Name" } );
// WORKS
LFForm.changeFieldOptions( { fieldId: 28 }, [{label: fullName, value: fullName, selected: true}], "add" );
// DOES NOT WORK
LFForm.changeFieldOptions( { variableName: "Customer" }, [{label: fullName, value: fullName, selected: true}], "add" );
This is the error I get when I use variableName:
about:srcdoc:32 Uncaught Error: Unable to find field. Please check your ID.
at Object.changeFieldOptions (about:srcdoc:32:4972)
at window.addOffender (eval at window.init (about:srcdoc:17:33), <anonymous>:12:10)
at eval (eval at <anonymous> (about:srcdoc:1:2404), <anonymous>:3:1)
at about:srcdoc:32:2459
Does this mean that LFForm.changeFieldOptions() doesn't support variableName? It's not very clear in the documentation.
EDIT: I also tried this and it returned null. Is this a bug then?
var customerFields = LFForm.findFieldsByVariableName("Customer"); // customerFields = null