I'm having some difficulties creating a lookup field to bring users from SDM in order to notify this contact contained in this field.
I created the data object for use in ca_fdDoFieldLookup according to the query below:
Fields: value, label
select contact_uuid as value, last_name as label from mdb.dbo.ca_contact where userid is not null
In the form i created a lookup field with the following attributes:
_id: ca_sdm_attr_z_SuperiorImediato (this custom attribute is a SREL from the cnt factory)
onLookup: ca_fdDoFieldLookup ('last_name', 'caContactPlugin')
When I select the field to view the values it does not give me a search option or even allows users to search with the value entered in the lookup field.
Is there anything I should do besides creating this query and making the field available?
Bellow the form and popup lookup field:
Many thanks for your help!
You need to pass the _id of the lookup field as the first argument similar to the following:
Also, note that the form field(s) that you want populated with the results of this lookup need to have the same _id as the column/alias in your data object. As an example, if you want the lookup field populated with the last_name from the data object you would either need to specify the lookup field _id as 'label' or update your query to alias last_name as 'ca_sdm_attr_z_SuperiorImediato'.
Good Morning Diego. The following is an example to get this working. In sc/admin/report builder, create a data object.type = queryid = catalog_contact_listdatabase = mdbtable = ca_contactfields = userid,first_name,last_namequery = 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 = useridonLookup= 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_nameThe 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 lastnameFROM ca_contactWHERE upper(userid) like upper('%STRING%%%') Then the _id of th fields on the form should be firstname and lastname.Equal to the ones that you use in the 'as' clause in the query-text. Thanks and kind regards, Louis van Amelsfort.
Many thanks for all the help!
I have changed my query to search the user based on last_name, however, when i try to select this user on the offer the value presented in the popup is not populated on the form.
Theres something that i can do to make this values "saved" onf the offer form?
Popup asking for the user name:
Value is not available on offer:
Many thanks again!
The form field(s) that you want to populate from the option selected in the lookup popup window need to be defined with an _id that matches the column/alias returned from your data object.
Good Morning Diego.
As to confirm Jason's comment, this is also mentioned in the info as provided earlier:
B: The 'text field' component on the form is the field to be filled with data from lookup:_id = first_name_id = last_nameThe 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.
Kind regards, Louis.