How to display knowledge article based on number instead of sys_id
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-24-2018 04:25 AM
How to display knowledge article based on number instead of sys_id
Ex: Giving
/sp=id?pagename&number=KB123456 -> but it is not working
if I give /sp=id?pagename&sys_id=123456c8a1374ef04c1d37a836144b0f2-> but it is working
- Labels:
-
Service Portal Development
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-13-2023 05:03 AM
Hi Vignesh,
in typeahead search widget if enter the article number and click the dropdown link, it should open URL with kb article number, but it is opening sys_id number. I need to change the Sys_id to article number.
below is the code
c.searchItems = result.results.map(function(item) {
var config = c.data.searchSourceConfiguration[item.__search_source_id__];
if (!item.url && config.linkToPage) {
item.url = "?id=" + config.linkToPage;
if (item.sys_id)
item.url += "&sys_id=" + item.sys_id;
}
If I am changing the "Item.url += "&sys_id=" + item.number;" it is showing undefined. where should I go and change the code.
Advance thx
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-13-2023 05:21 AM
Hi shayam1,
If you want to use kb number in the URL, use it like this
/sp?id=kb_article&sysparm_article=KB0000028
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-16-2023 07:29 AM
Hi Vignesh,
If we write directly it is working , but I need to modify the code in typeahead widget, because if I click the link/dropdown value click then only it should redirect to article number.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-24-2018 07:49 AM
This video will help you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-23-2024 04:56 AM
Hello,
you can use "https://<intance-name>.service-now.com/sp?id=kb_article&sysparm_article=KBXXX"
sysparm_article instead of sys_id