"ErrorServer JavaScript error undefined is not a function" when updated to Rome version
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-09-2022 03:43 AM
After the environment was updated to the Rome version, when try generate a PDF the error started to appear: ErrorServer JavaScript error undefined is not a function.
The error points to the include script: "GeneralPDF" on the line where it calls another include script: "iTextPDFUtil"
Attached are the include scripts.
Could you help me by informing if there is something wrong or that it is no longer accepted in the Rome version?
- Labels:
-
Service Portal Development

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-13-2022 01:28 AM
I've looked in my Rome instance and there is script include named "GeneralPDF" and "iTextPDFUtil".
Content of the files are the same as those attached in the question.
I've executed the following script and was able to successfully generated a PDF file attachment to an incident.
var v = new sn_pdfgeneratorutils.PDFGenerationAPI;
var tableSysId = "<sys_id of incident>";
var gr = new GlideRecord("incident");
var html;
if (gr.get(tableSysId)) {
html = gr.description.toString();
}
var result = v.convertToPDF(html, "incident", tableSysId, "myPDF");
gs.info(JSON.stringify(result));
Would need error message with script that was executed to find the problem.