I want to display hyper link with record number id if I created a record another table
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-02-2023 10:08 PM
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-02-2023 10:46 PM
Hi @APV Babu,
Is there any field which refer table 1 record in table 2 ?
If yes then create after insert BR in Table 2 & add below code snippet in BR.
e.g. table1 : incident, table2 : problem
(function executeRule(current, previous /*null when async*/) {
var inc = new GlideRecord('incident');
inc.get(current.first_reported_by_task.toString());
// first_reported_by_task is field in problem table refering to incident
// 1st method to create hyperlink
inc.u_hyperlink = "<a href='" + current.getLink(true) + "' target='_blank'>" + current.number + "</a>" ;
// 2nd method to create hyperlink
//inc.u_hyperlink = "<a href='incident.do?sys_id=" + current.sys_id + "' target='_blank'>" + current.number + "</a>";
inc.update();
})(current, previous);
Output:
Field type should be HTML.
If your question is solved, please close the topic by marking my answer "Accept as Solution". This will help others searching for a similar question and will remove the topic from the unsolved list.