Hi Hernan.
The following is an example to get this working.
In sc/admin/report builder, create a data object.
type = query
id = catalog_contact_list
database = mdb
table = ca_contact
fields = userid,first_name,last_name
query = SELECT userid,first_name,last_name
FROM ca_contact
WHERE upper(userid) like upper('%STRING%%%')
In SC/Catalog/Forms, create a form with:
A: The Lookup component on the form:
_id = userid
onLookup= ca_fdDoFieldLookup('userid','catalog_contact_list')
NOTE: userid is the first field of the data object fields.
id-value is the id of the data object
B: The 'text field' component on the form is the field to be filled with data from lookup:
_id = first_name
_id = last_name
The value for '_id' must be equal to the field in the data object.
And will then be automatically populated when the query executes.
E.G. for another text field on the form, to be populated with the contact's first_name (as in the query-text),
the _id of that field must/should be first_name too.
Does this answer your question? And help you further on this?
PS.
When you change the query into:
query =
SELECT userid,first_name as firstname,last_name as lastname
FROM ca_contact
WHERE upper(userid) like upper('%STRING%%%')
Then the _id of th fields on the form should be firstname and lastname.
Equal to the ones that youuse in the 'as' clause in the query-text.
Thanks and kind regards, Louis.