Number as hyper link
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2025 04:03 AM
Hi all,
i want Number as hyper link (Incident,problem,Hr profile tables) when we click on context menu just like copy to clipboard i have created a context menu as HTML-formatted link when user click on this the incident number should be copied as hyperlink, screen shot shared below for reference
By using below code i am able to copy the Number as text.
runContextNumberAction();
function runContextNumberAction(){
var gr = new GlideRecord(g_list.getTableName());
gr.get(g_sysId);
copyToClipboard(gr.number);
}
i need help on this.
Thanks.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2025 04:15 AM
@shaik23 You can try building the link using the following.
runContextNumberAction();
function runContextNumberAction(){
var gr = new GlideRecord(g_list.getTableName());
gr.get(g_sysId);
var instanceURL = gs.getProperty('glide.servlet.uri');
var recordURL = instanceURL + '/nav_to.do?uri=incident.do?sys_id=' + gr.getUniqueValue(); // Construct the link
// Create HTML-formatted link
var htmlLink = `<a href="${recordURL}" target="_blank">gr.getValue('number')</a>`;
copyToClipboard(htmlLink);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2025 04:22 AM
Hi @Sandeep Rajput Thanks for responding
what is type of the context menu should be selected is it action or Dynamic action if Dynamic actions we have to write script for that too right ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2025 04:25 AM
@Sandeep Rajput Tried Not working selected type - Action, Nothing copied to clipboard

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2025 04:30 AM
@shaik23 Please add logs to see of the link is getting generated correctly or not.