Using a method that creates arrays from the results of SQL queries and that is attached to the onRecordSelected event, I am populating 3 value lists attached to 3 comboboxes on a form. While the valuelists themselves are created properly, the form does not seem to be able to display the matching values in the 2nd or 3rd combobox. It seems like the method doesn’t have enough time to finish populating the value lists before the form wants to display itself.
Here is more detail. I have a table called ‘persons’ where a person’s first and last name are stored. I have another table called ‘contacts’ where a person_sn and a client_sn can be matched to make a contact for a client. Contact records also store flags indicating that a contact can be selected as a job contact, a bill-to contact and/or a ship-to contact. I have a third table called ‘quotes’ that stores contact_sn’s for a quote’s job contact, bill-to contact and ship-to contact. When a user clicks on the combobox for a quote contact, the choices should be limited to contacts that are appropriate for the type of contact (i.e. click on job contact and only contacts for that quote’s client that are flagged to be included as job contacts appear). Normally, I would use a relationship to build this value list, however I want only the contact’s name to appear in the value list and only the contact_sn to be returned to the dataprovider, and the name isn’t stored in the ‘contacts’ table, its in the ‘persons’ table.
As I said, the value lists themselves are created correctly, but even though there are contact_sn’s stored in the quote’s contacts dataproviders and those contact_sn’s do match values present in the value list, the matching names only display in the first combobox and not the second or third. It seems like a timing issue to me. Attached is a sample solution.
Thanks in advance,
Steve in LA
051018_value_list_bug.servoy (73.6 KB)