- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-06-2021 12:40 AM
Hi,
There is a reference field named as 'Asset' in my change form.
When we click on search icon we have below columns.
Right now we can able to search based on column 'Name'.
I want a user can able to search the asset directly by typing in refence field using column 'Name' - name and 'Asset Tag' - asset_tag. When he give name then also it will show the result and if the user give asset tag then also he can able to search.
Right now I am getting below error when I am trying to search using asset tag.
Below is the field dictionary :
What script I need to write and where? Please help?
Thanks.
Solved! Go to Solution.
- Labels:
-
Change Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-06-2021 02:24 AM
Hi,
then using this it should work
ref_auto_completer=AJAXTableCompleter,ref_ac_columns=name;asset_tag,ref_ac_columns_search=true
Are you checking with admin or non-admins
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-06-2021 12:56 AM
Hi,
You can use attributes for reference field
Auto-complete for reference fields
ref_auto_completer=AJAXTableCompleter,ref_ac_columns=asset_tag,ref_ac_columns_search=true
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-06-2021 01:09 AM
Hi Ankur,
I want to search based on 2 columns.
1. name
2. asset_tag
But when I am giving your query in attributes field, it is populating correctly. But when I am trying to search using name then it is giving invalid reference and unable to search.
Giving below query :
ref_auto_completer=AJAXTableCompleter,ref_ac_columns=name;asset_tag,ref_ac_columns_search=true
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-06-2021 01:19 AM
Hi,
which table is being referred?
Is it alm_asset? if yes then the field is display_name and not name
ref_auto_completer=AJAXTableCompleter,ref_ac_columns=display_name;asset_tag,ref_ac_columns_search=true
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-06-2021 01:24 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-06-2021 01:27 AM