- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-15-2024 07:03 PM
I have 2 catalog items catalog items A and B. Cat item B is autogenerated from cat item A. I need to get Clickable request number for item A in the worknote of cat B. Any Suggestions?
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-20-2024 06:39 AM
Hi @Cindy Sim you need to use below code while updating worknotes to make clickable
[code]New request created: <a href="/sc_request.do?sys_id="+current.sys_id target="_blank">click here</a> <br/>
[/code]
Harish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-15-2024 07:13 PM
Before Insert Business rule on sc_cat_item table, adjust the below code template:
(function executeRule(current, previous /*null when async*/) {
// Check if the current record is a newly inserted record
if (current.operation() == 'insert') {
// Get the Request Number from the parent record (Catalog Item A)
var parentRequestNumber = current.parent.getDisplayValue();
// Generate the clickable link
var clickableLink = "<a href='" + gs.getProperty('glide.servlet.uri') + "sc_request.do?sys_id=" + current.parent + "'>" + parentRequestNumber + "</a>";
// Append the clickable link to the work notes of Catalog Item B
current.work_notes = "Linked to Request: " + clickableLink + "\n" + current.work_notes;
}
})(current, previous);
Above example assumes that the reference field linking Catalog Item B to Catalog Item A is named "parent" in the "sc_cat_item" table. Adjust the script according to your actual field names.
Kindly mark helpful/accepted if it helps you.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-16-2024 06:35 AM
Thank you for the reply. This script is working in bringing the request number. But I am still not able to create the clickable link to the Request. Do you have any suggestions on that?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-16-2024 06:42 AM
I have updated the code little bit..Can you try once
(function executeRule(current, previous /*null when async*/) {
if (current.operation() == 'insert') {
// Get the Request Number from the parent record (Catalog Item A)
var parentRequestSysId = current.parent;
var parentRequestNumber = new GlideRecord('sc_request');
if (parentRequestNumber.get(parentRequestSysId)) {
var linkURL = gs.getProperty('glide.servlet.uri') + "sc_request.do?sys_id=" + parentRequestSysId;
var clickableLink = "<a href='" + linkURL + "'>" + parentRequestNumber.getValue('number') + "</a>";
// Append the clickable link to the work notes of Catalog Item B
current.work_notes = "Linked to Request: " + clickableLink + "\n" + current.work_notes;
}
}
})(current, previous);
Please Mark ✅Correct if this solves your query and also mark 👍Helpful if you find my response worthy based on the impact.
Thanks

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-15-2024 07:17 PM
Hi @Cindy Sim how are you generating the Cat Item B? is it through flow designer?
Harish