diff --git a/Client-Side Components/UI Actions/Generate PDF/generatePDFWithDetails.js b/Client-Side Components/UI Actions/Generate PDF/generatePDFWithDetails.js new file mode 100644 index 0000000000..9a48246cce --- /dev/null +++ b/Client-Side Components/UI Actions/Generate PDF/generatePDFWithDetails.js @@ -0,0 +1,15 @@ +//Setting up the content of the PDF that will be generated +//It contains - Short Description, Number, Caller ID, Priority, Assignment Group and Description +var content = + '
' + + '

' + current.short_description + '

' + + '

Number: ' + current.number + '

' + + '

Caller: ' + current.getDisplayValue('caller_id') + '

' + + '

Priority: ' + current.getDisplayValue("priority") + '

' + + '

Assignment Group: ' + current.getDisplayValue('assignment_group') + '

' + + '

Description: ' + current.getDisplayValue("description") + '

' + + '
'; + + +new sn_pdfgeneratorutils.PDFGenerationAPI().convertToPDF(content, current.sys_class_name, current.sys_id, current.number); +action.setRedirectURL(current); diff --git a/Client-Side Components/UI Actions/Generate PDF/readme.md b/Client-Side Components/UI Actions/Generate PDF/readme.md new file mode 100644 index 0000000000..eb259b86d3 --- /dev/null +++ b/Client-Side Components/UI Actions/Generate PDF/readme.md @@ -0,0 +1,21 @@ +This is an UI action script written on the [incident] table in ServiceNow. +This helps to generate PDF file with the current incident record details and attaches it to the same record. + + + +UI Action Details: + +Name: Attach INC Details +table: incident +Active: true +Show Update: true +Form button: true +Condition: /as per requirement/ +Script: check the [generatePDFWithDetails.js] file + + +Output: + +image + +