- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-11-2024 11:41 AM - edited ‎09-11-2024 12:03 PM
Its hunting since from beginning, if anyone can explain how to frame a link dynamically.
I am able to print the short description and article number from the script include only issue is I am failing to insert a link with name as combination of kb number & kb short description??
Its been throwing error just to save itself .
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-11-2024 12:41 PM
Then you need to create variables for it, based on your requirements.
var kb = current.knowledge_article;
var sys_id = query to the sys_id of your article;
var url = 'https://your_url.service-now.com/now/nav/ui/classic/params/target/kb_knowledge.do%3Fsys_id%3D' + sys_id;
then you can just make it [code]<a href=" + url + ">' + kb + '</a>[/code]
My PDI is sleeping, so I can't validate the exact code, but it should work, something like this.
Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-12-2024 07:54 PM - edited ‎09-12-2024 07:55 PM
var kb= 'https://your-instance.service-now.com/kb_knowledge.do?sys_id=' +knb.sys_id
var link = knbNumber + ' - ' + knbShortDescription;( this should be ur script include data)
var htmlLink = [code]<a href="' + kb+ '" target="_blank">' + link + '<a>[code]
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-11-2024 11:59 AM
Check this blog: https://www.servicenow.com/community/in-other-news/formatting-within-journal-fields-using-html-amp-c...
One note: it could be that usage of formatting within work notes/comments is turned off for security reasons. In that case using anything with [code][/code] won't work.
Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-11-2024 12:04 PM - edited ‎09-11-2024 12:13 PM
Thanks @Mark Manders for your reply.!!
I am trying in my personal developer instance itself.
when I used [code]<a href="https://www.servicenow.com">ServiceNow.com</a>[/code] its populating servicenow link into worknotes as shown below
but I want to make it dynamic. here I am facing issues with framing link itself.
I want to populate a link with kb short description & number that i am getting from script include.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-11-2024 12:41 PM
Then you need to create variables for it, based on your requirements.
var kb = current.knowledge_article;
var sys_id = query to the sys_id of your article;
var url = 'https://your_url.service-now.com/now/nav/ui/classic/params/target/kb_knowledge.do%3Fsys_id%3D' + sys_id;
then you can just make it [code]<a href=" + url + ">' + kb + '</a>[/code]
My PDI is sleeping, so I can't validate the exact code, but it should work, something like this.
Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-12-2024 07:54 PM - edited ‎09-12-2024 07:55 PM
var kb= 'https://your-instance.service-now.com/kb_knowledge.do?sys_id=' +knb.sys_id
var link = knbNumber + ' - ' + knbShortDescription;( this should be ur script include data)
var htmlLink = [code]<a href="' + kb+ '" target="_blank">' + link + '<a>[code]