Hi team,
I came across a weird issue when using a Collection that contained read only fields that were populated by a Lookup not saving data upon submission in Laserfiche Forms 10.
The use case is to provide users with the ability to easily update the details of their "Open Tickets" in a controlled way via form submission using a Collection.
More specifically, we want to allow users to change for example, the Primary Contact details of a ticket by being presented with a drop-down list that populates other read-only fields (e.g. First Name, Last Name, Title, Email) with the data from a lookup.
To start, we use a Collection populated by a data-source. The purpose is to update Tickets, not add or remove them. As a side note: We use CSS to remove the ability to delete.
Using the above Collection configuration, we add several fields regarding the current "Account Manager" information.
A read-only input field shows the current "Account Manager" which populates as expected, along with several other hidden read-only fields (first name, last name, title etc) for each ticket returned by the lookup rule. e.g. "John Doe"
When "Change Account Manager" is selected, the user is presented with a drop down field "Select New Account Manager" that is populated by, in our case, an Active Directory lookup rule.
Upon selecting the user from the drop down, their title, first name, last name etc, are populated by lookup rules into the relevant fields e.g. "Jane Smith". These fields are read-only to ensure data integrity. The information displays correctly on the front end.
This is where it gets weird.
If you submit the form, the collection ignores any data populated in the read-only fields that were populated by the lookup. Instead, it retains the originally looked up collection values. However, if these fields (first name, last name, email etc) are made editable, they save their values correctly. Mind boggling.
Current Workaround / Solution
So, our current workaround is to make the fields for first name, last name etc editable/not read-only and hide them using a custom css class (or field rules). This is problematic for fields where we want to display information to the end user but can't enforce constraints (e.g. free text fields, email addresses etc).
I haven't had a chance to test this with LF11 yet but I've been able to reproduce this issue consistently on LF10.
Are others able to reproduce this issue? Any thoughts on this behaviour?
I'd like to mention that when you use "Range of Sets", "Fixed Number of Sets" the issue does not occur and read-only fields populated by lookups commit data as expected.
CC: @████████ @████████