I have a lookup field in a SC form in wich i use ca_fdDoFieldLookup('userid', 'catalog__content_contacts_list') wich retrieves the user id and is working fine, now i wanna know if i cant get the First name and last name of that user_id in another text field. Is it possible?.
I-m trying to do this because i can-t get the Full_name in the result of the ca_fdDoFieldLookup.
Please let me know if i did no explaine myself right, thanks in advance.
PD> the ca_fdDoFieldLookup('userid', 'catalog__content_contacts_list') brings information from ca_contacts in CA SDM.
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 youuse in the 'as' clause in the query-text.
Thanks and kind regards, Louis.
i was able to populate a new text field with the Last name and the First name so it is working good, now how can i make them show up in the same text field: Last_name + First_name?
You can do something like the following:
select last_name+', '+first_name as cn from ca_contact where userid='%userid%'
Just ensure the _id of the text field you want to populate is defined with the alias (i.e. 'cn' above).
Can i do the " last_name+', '+first_name " at form level? i can't get it working as data object query...
Query: select last_name+', '+first_name as cn from ca_contact where userid='%userid%'
Thanks a lot!! that worked for me!!
Y4eezdAwq pd D
J.P. Morgan Asset Management
AM Tech PMO
4041 Ogletown Road, Floor 2
Newark, DE 19713-3159