I have a valuelist with a global function for a typeahead field, that return the name of a customer, because I need the name to be stored in the dataprovider. After the customer is selected, I use a relation that is defined by customername to customername to update the other customer fields, like customerId etc., in my document. The problem is, if the customer name exists twice, the other fields could not be updated, if I select the other customer name in the typeahead field.
How can I get also the identifier for the customer record?
Harjo:
Than you need a valuelist that shows names but returns some kind of ID. Than a relation back to you customers from ID to ID
Hello Harjo, but I need the customer name in the dataprovider from the field where the typeahead valuelist method is attached. If I do your suggestion, then the id is returned to the dataprovider. That is what I want to avoid.
I changed the customer name dataprovider to the customer id and return the customer id from the global valuelist method. In the valuelist I added a fallback valuelist from the table where I store the customer name and id. The valuelist is configured to show the customer in the field and return the customer id to the dataprovider.
This seems to work, except for the Servoy Framework find mode. If I want to search for a customer name, it does not find the desired records.
The observed the problem in the Servoy Framework function svy_sea_search. I have 2 fields on my form: fld_customer_number and fld_customer_name which both have the dataprovider anmand attached, which the customer id number. The field fld_customer_name has the above valuelist with fallbackvaluelist attached, so it displays the customer name.
deezzub:
I changed the customer name dataprovider to the customer id and return the customer id from the global valuelist method. In the valuelist I added a fallback valuelist from the table where I store the customer name and id. The valuelist is configured to show the customer in the field and return the customer id to the dataprovider.
This seems to work, except for the Servoy Framework find mode. If I want to search for a customer name, it does not find the desired records.