Skip to content

Commit 0da4fa8

Browse files
authored
Record as link for Any table for PDF, Notifications and more.. (#2432)
* Adding Record as Link Util * Fix grammar and formatting in README.md Corrected minor grammatical errors and formatting in the README. * Adding PDF generation for incident links Implement PDF generation for incident links using RecordToHTML utility. * Remove PDF generation example from README Removed example usage section for PDF generation from README. * Clean up README formatting Removed unnecessary line from README.
1 parent f3f98f7 commit 0da4fa8

File tree

3 files changed

+48
-0
lines changed

3 files changed

+48
-0
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Record as a Link Utility
2+
3+
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.
4+
5+
## Features
6+
7+
- Dynamically render records based on selected table and fields.
8+
- Generate clickable links for seamless navigation.
9+
- Compatible with various use cases like notifications, reports, and document generation.
10+
11+
## Use Cases
12+
13+
- **Notifications**: Display dynamic links to records in notification messages for any record in serviceNow
14+
- **PDF Generation**: Embed clickable record links in generated PDFs.
15+
- **Custom Applications**: Use in any HTML field to enhance interactivity.
16+
17+
## How to Use
18+
19+
Use the utility as used given code and merge it with other html. example attached for reference.
20+
21+
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
var recordToLinkUtil = new RecordToHTML("incident", "1c741bd70b2322007518478d83673af3",
2+
"incident: ${number}-${short_description}",true);
3+
4+
//Adding link as html
5+
var html = '<h1>Incident Link is genearted</h1>\n' + recordToLinkUtil.toString();
6+
7+
8+
9+
var fileName = 'Test File with RecordLink';
10+
var tableName = 'incident';
11+
var recordSysId = "a623cdb073a023002728660c4cf6a768";
12+
13+
// Generate PDF and attach
14+
var pdfResult = new sn_pdfgeneratorutils.PDFGenerationAPI().convertToPDF(
15+
html,
16+
tableName,
17+
recordSysId,
18+
fileName,
19+
''
20+
);
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
function getLink() {
2+
var recordToLinkUtil = new RecordToHTML("YOUR_TABLE_NAME", "RECORD_SYS_ID",
3+
"CUSTOM_TEXT_TO_ADD_BEFORE_LINK: ${number}-${short_description}", true);
4+
return recordToLinkUtil.toString();
5+
}
6+
7+

0 commit comments

Comments
 (0)