From 02067749cc3e8df697432d045a72789c7f982580 Mon Sep 17 00:00:00 2001 From: Nilesh Wahule <77268537+Its-Nmk@users.noreply.github.com> Date: Wed, 22 Oct 2025 23:20:34 +0530 Subject: [PATCH 1/2] Adding Record as Link Util --- .../Server Side/Record as Link/README.md | 43 +++++++++++++++++++ .../Record as Link/recordAsLink.js | 7 +++ 2 files changed, 50 insertions(+) create mode 100644 Server-Side Components/Server Side/Record as Link/README.md create mode 100644 Server-Side Components/Server Side/Record as Link/recordAsLink.js diff --git a/Server-Side Components/Server Side/Record as Link/README.md b/Server-Side Components/Server Side/Record as Link/README.md new file mode 100644 index 0000000000..413ec15fb3 --- /dev/null +++ b/Server-Side Components/Server Side/Record as Link/README.md @@ -0,0 +1,43 @@ +# Record as a Link Utility + +The **Record as a Link Utility** is a versatile tool designed to dynamically render records as clickable links in any HTML field. for any table. This utility allows you to choose specific fields to display, making it ideal for use cases such as notifications, generating PDFs, and more. + +## Features + +- Dynamically render records based on selected table and fields. +- Generate clickable links for seamless navigation. +- Compatible with various use cases like notifications, reports, and document generation. + +## Use Cases + +- **Notifications**: Display dynamic links to records in notification messages for any record in serviceNow +- **PDF Generation**: Embed clickable record links in generated PDFs. +- **Custom Applications**: Use in any HTML field to enhance interactivity. + +## How to Use + +Use the utility as used given code and merge it with other html. example attached for reference. + + +## Example Usage for PDF Generation + +``` +var recordToLinkUtil = new RecordToHTML("incident", "1c741bd70b2322007518478d83673af3", +"incident: ${number}-${short_description}",true); + + var html = '

Incident Link is genearted

\n' + recordToLinkUtil.toString(); + var fileName = 'Test File with RecordLink'; + var tableName = 'incident'; + var recordSysId = "a623cdb073a023002728660c4cf6a768"; + + // Generate PDF and attach + var pdfResult = new sn_pdfgeneratorutils.PDFGenerationAPI().convertToPDF( + html, + tableName, + recordSysId, + fileName, + '' + ); + + ``` + diff --git a/Server-Side Components/Server Side/Record as Link/recordAsLink.js b/Server-Side Components/Server Side/Record as Link/recordAsLink.js new file mode 100644 index 0000000000..fb34a35011 --- /dev/null +++ b/Server-Side Components/Server Side/Record as Link/recordAsLink.js @@ -0,0 +1,7 @@ +function getLink() { + var recordToLinkUtil = new RecordToHTML("YOUR_TABLE_NAME", "RECORD_SYS_ID", + "CUSTOM_TEXT_TO_ADD_BEFORE_LINK: ${number}-${short_description}", true); + return recordToLinkUtil.toString(); +} + + From f13371dc895a330eeb00f7de7d118cbb7b3f1138 Mon Sep 17 00:00:00 2001 From: Nilesh Wahule <77268537+Its-Nmk@users.noreply.github.com> Date: Wed, 22 Oct 2025 23:27:17 +0530 Subject: [PATCH 2/2] Fix grammar and formatting in README.md Corrected minor grammatical errors and formatting in the README. --- Server-Side Components/Server Side/Record as Link/README.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Server-Side Components/Server Side/Record as Link/README.md b/Server-Side Components/Server Side/Record as Link/README.md index 413ec15fb3..75ff4ee00c 100644 --- a/Server-Side Components/Server Side/Record as Link/README.md +++ b/Server-Side Components/Server Side/Record as Link/README.md @@ -1,6 +1,6 @@ # Record as a Link Utility -The **Record as a Link Utility** is a versatile tool designed to dynamically render records as clickable links in any HTML field. for any table. This utility allows you to choose specific fields to display, making it ideal for use cases such as notifications, generating PDFs, and more. +The **Record as a Link Utility** is a versatile tool designed to dynamically render records as clickable links in any HTML field for any table. This utility allows you to choose specific fields to display, making it ideal for use cases such as notifications, generating PDFs, and more. ## Features @@ -21,7 +21,7 @@ Use the utility as used given code and merge it with other html. example attache ## Example Usage for PDF Generation -``` +```javascript var recordToLinkUtil = new RecordToHTML("incident", "1c741bd70b2322007518478d83673af3", "incident: ${number}-${short_description}",true); @@ -38,6 +38,5 @@ var recordToLinkUtil = new RecordToHTML("incident", "1c741bd70b2322007518478d836 fileName, '' ); - ```