Looking to customize 'Contextual Search'

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-19-2016 01:03 PM
Hello,
There is a "Related Search Results" in our Incident form, when user clicks the 'Attach' button, the knowledge article is added to the Additional Comments field.
Like that, we need the 'Attach' button also to populate the Knowledge Article number in the 'KB Article' (custom reference field) on the form.
Or, create another button next to 'Attach' button to populate the KB # in the "KB Article" reference field on the form.
Need help to customize this module.
Thanks,
Rajini
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-20-2016 10:50 AM
Hello Rajini,
To clarify, is this attach button one that was customized and added for your particular Incident form?
Thank you,
-Mel

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-21-2016 02:00 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-21-2016 04:38 PM
The attach functionality is in cxs_Knowledge script include. But you cannot edit it. If you would like to add additional functionality to it you have to extend this script include and update getArticleInfo function
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-21-2016 08:27 PM
The "attach" button comes from a macro. if you want additional widgets beside those button , you need to customize the "cxs_result_table" which is a part of contextual search plugin. Currently the code looks like this.
All you have to do is add one more button tag in <td> element. After adding a button , the code will look like this.
After adding a button you can listen for click events from any client script and populate the custom reference fields by using g_form methods.
Please remember to delete this macro before upgrading your instance. so that you will always get the latest update from Servicenow.
Thanks