auto complete reference fields not working

Community Alums
Not applicable

I am trying to use the autocomplete function on the change form, CI field. I am using the following...

ref_auto_completer=AJAXTableCompleter,ref_contributions=task_show_ci_map;show_related_records,ref_ac_columns=sys_class_name;manufacturer;model_id;serial_number,ref_ac_order_by=sys_class_name,ref_ac_columns_search=true

However, I am unable to search by sys_class_name. I can type anything else in the field and it will narrow down, class name does nothing. Thoughts?

7 REPLIES 7

LaurentChicoine
Tera Guru

Class name is searched with the value behind (table name)... So it searches for match with for example: cmdb_ci_service instead of business service.



The only workaround i see for this is to create a new field (Translated text type if you use multi language) on the cmdb_ci table that stores the Label of the table. You would populate that field with a business rule (can be more complex if you have to create translated text). You would have a on insert/update before business rule when the sys_class_name changes. Also you would need business rules on the Table labels to update that field if they get updated (unless you don't plan on updating them). And for existing record in your CMDB you would need a fix script.



I fin this customization quite complex related to the value it adds. Maybe you should submit an enhencement request instead (and be patient).


I am trying to get this right, but I am not able to.

 

There is a reference field on Incident form called Business Service which is referencing to cmdb_ci_service class.

 

I am using this attribute to show and search these columns : NAME, u_acronym

 

all_tables.text_index_translations=true,ref_ac_columns_search=true,ref_ac_order_by=name,ref_ac_columns=name;u_acronym,ref_auto_completer=AJAXTableCompleter

 

But I am not able to see the column u_acronym to search for and auto-complete is not showing this column as well. 

 

u_acronym is the custom field created on business service class and is of type String.

 

Hi, I looked it up in a developper instance and your issue seems to be that there is an OOB dictionary override on the incident table for the attributes on the business service field.

Simply update the attributes from the dictionary override or disable/delete it.

Fantastic..!! It worked. Thank you so much Laurent Chicoine..!!