Skip to content

Commit 3ccbd2e

Browse files
authored
generatePDFWithDetails.js
This script generated a PDF file with the details and attaches it to the same record.
1 parent be1fd1a commit 3ccbd2e

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
//Setting up the content of the PDF that will be generated
2+
//It contains - Short Description, Number, Caller ID, Priority, Assignment Group and Description
3+
var content =
4+
'<div style="font-family: Arial, sans-serif; font-size: 14px; color:#333; padding:8px;">' +
5+
'<h2 style="color:#0b5cab; font-weight:bold; margin-bottom:10px;">' + current.short_description + '</h2>' +
6+
'<p><b>Number:</b> ' + current.number + '</p>' +
7+
'<p><b>Caller:</b> ' + current.getDisplayValue('caller_id') + '</p>' +
8+
'<p><b>Priority:</b> ' + current.getDisplayValue("priority") + '</p>' +
9+
'<p><b>Assignment Group:</b> ' + current.getDisplayValue('assignment_group') + '</p>' +
10+
'<p><b>Description:</b> ' + current.getDisplayValue("description") + '</p>' +
11+
'</div>';
12+
13+
14+
new sn_pdfgeneratorutils.PDFGenerationAPI().convertToPDF(content, current.sys_class_name, current.sys_id, current.number);
15+
action.setRedirectURL(current);

0 commit comments

Comments
 (0)