- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-22-2016 02:08 AM
Hi All,
Is it possible to change the default auto complete and search filter on a referenced field look up list?
We have a 'Configuration Item' reference field on our Incident form that references the CMDB. We have set up reference specification to only reference specific classes; however by default it auto completes on the 'name' field of the CI which we dont use. We want to be able to search by asset tag instead but I don't seem to be able to find a way to change this behaviour. Also clicking the magnifying glass to search provides a list of empty names - it is possible to change the filter each time to find what is required but would be nice if this could be changed by default.
Is it possible?
I've also tried another approach by utilising the name field as a calculated field with the following to create a meaningful name which could be used current.u_asset + " " + current.u_manufacturer + " " + current.model_number + " " + current.u_device_type; (ie Asset001 HP Elitebook Laptop - perfect for the lookup)
This appeared to work, however I soon noticed this had negative impact as we use the name field for Business Services (really the only thing it is used for) and obviously this calculation affected these names ('Undefined Undefined Undefined Undefined' as none of these fields are present).
Is there any other way i can do something like this?
Thanks
Paul
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-22-2016 04:09 AM
You can define the columns to be searched against in the Auto Complete using the attribute 'ref_ac_columns'. And set the attribute 'ref_ac_columns_search' to true by which the search can be performed on the these columns defined for auto complete. For more details refer Dictionary Attributes - ServiceNow Wiki
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-22-2016 04:09 AM
You can define the columns to be searched against in the Auto Complete using the attribute 'ref_ac_columns'. And set the attribute 'ref_ac_columns_search' to true by which the search can be performed on the these columns defined for auto complete. For more details refer Dictionary Attributes - ServiceNow Wiki
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-22-2016 06:17 AM
Thanks for the Suggestion Guhun however im struggling getting this to work.
Assuming i've understood you correctly (and it may be more likely that i havn't ), here's the setup :-
the 'Configuration Item' reference field from our Incident form refers the 'cmdb_ci' table
I've set the attribute of 'u_asset' from the 'cmdb_ci_computer' (This table extends 'cmdb_ci_hardware' which in turn extends cmdb_ci) table to ref_ac_columns=true,ref_ac_columns_search=true
Is this correct?
It doesn't seem to work. The reference field still only auto completes from name.
Thanks again for your help with this.
Cheers
Paul
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-22-2016 06:51 AM
Sorry i thought i'd got it working but was still referencing data in the name field.
Here's what i've done :-
Right click the Reference field label and choose 'Personalise Dictionary' - in here there is the 'Attributes' field. I've got the below here :-
ref_auto_completer=AJAXTableCompleter,ref_ac_columns_search=true,ref_ac_columns=u_asset;sys_class_name,ref_ac_order_by=u_asset
From my understanding this should provide auto complete results when i start to enter the asset tag. Displaying a list of Assets with the CI class (Computer, Servet etc..). So if i typed into this box LD0001 i would expect to see for example
LD0001 Computer
LD00010 Printer
Ld00011 Server
I do get these results, however prefaced with the Name and when selected the name populates the field which is not what want to be displayed. I want the field to display the value of u_asset.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-22-2016 08:07 AM
Hi Paul,
I think you see the name as it is set as display value on your referenced table. If you override it to be an asset tag you should see that instead.
Cheers
Greg