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..c527cb58e0 --- /dev/null +++ b/Client-Side Components/UI Actions/Generate PDF/README.md @@ -0,0 +1,7 @@ +Description: +This UI Action enables users to generate and download the current record in PDF format from the workspaces. It is particularly useful in the Incident table for PIR (Post-Incident Review) documents after resolution. +Currenty we don't have any option to export the record in the PDF format from Workspace. Users must go to the native/classic view to export the record. + +Pre-requisite: +A dedicated form view must be created containing all relevant fields such as Resolution Code, Resolution Notes, Assignment Group, Assigned To, and others required for comprehensive reporting. +In this code, I've used the view name called 'pdf_export' which is already created in the Incident table diff --git a/Client-Side Components/UI Actions/Generate PDF/Script.js b/Client-Side Components/UI Actions/Generate PDF/Script.js new file mode 100644 index 0000000000..96e64f03f9 --- /dev/null +++ b/Client-Side Components/UI Actions/Generate PDF/Script.js @@ -0,0 +1,9 @@ +// UI Action: Generate PDF +// Table: Incident +// Condition: current.state=='6' //Resolved +// Client true +// sysparm_view = pdf_export +function onClick(g_form) { + var url = '/'+g_form.getTableName() + '.do?sys_id=' + g_form.getUniqueValue() + '&PDF&sysparm_view=pdf_export'; + top.window.open(url, '_blank'); +}