How do I display a clickable URL in my work notes? Please do not use the example that uses [code].

Takakazu Sato
Tera Contributor

I want to display a clickable URL (hyperlink) in my work notes. Currently, clickable URLs can be displayed by enclosing them in [code] [/ code], but I would like to know how to display clickable URLs without writing [code] [/ code] directly in the work notes. 

1 ACCEPTED SOLUTION

Harsh Vardhan
Giga Patron

You can build href tag inside code. 

Sample eg:

 

var gr = new GlideRecord('incident');
gr.get('f71105bd2fc37010f68d5ff62799b62d');
var url = '[code]<a href="' + gs.getProperty('glide.servlet.uri') + '/'+gr.getTableName() + '.do?sys_id=' + gr.sys_id + '" target="_blank">' + 'My Record' + '</a>[/code]';

gr.work_notes= url;
gr.update();

 

Quick Demo

 

find_real_file.png

 

If my answer helped you, kindly mark it as correct and helpful.

View solution in original post

8 REPLIES 8

Harsh Vardhan
Giga Patron

You can build href tag inside code. 

Sample eg:

 

var gr = new GlideRecord('incident');
gr.get('f71105bd2fc37010f68d5ff62799b62d');
var url = '[code]<a href="' + gs.getProperty('glide.servlet.uri') + '/'+gr.getTableName() + '.do?sys_id=' + gr.sys_id + '" target="_blank">' + 'My Record' + '</a>[/code]';

gr.work_notes= url;
gr.update();

 

Quick Demo

 

find_real_file.png

 

If my answer helped you, kindly mark it as correct and helpful.

I thought you dont have script for [code], my bad.

Updating on my above response, why not using [code] ?

Maik Skoddow
Tera Patron
Tera Patron

Hi @Takakazu Sato 

unfortunately, wrapping HTML code into [code][/code] is the only way to get a URL rendered as a clickable link in the work notes.

What is, if I may ask, the reason why you don't want to use the given approach?

Kind regards
Maik

If my answer replied your question please mark appropriate response as correct so that the question will appear as resolved for other users who may have a similar question in the future.

Hi @Maik Skoddow ,

 

Can you please help me with creating hyperlinks without an instance URLs? below is my code and how it is working now.

Screenshot 2022-11-30 at 7.49.07 PM.pngScreenshot 2022-11-30 at 7.48.55 PM.png