<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: PDF Generation in Geneva in Developer forum</title>
    <link>https://www.servicenow.com/community/developer-forum/pdf-generation-in-geneva/m-p/1751130#M408056</link>
    <description>&lt;P&gt;Hi Syed - have you made any progress getting this solution to work in Helsinki? The point at which it breaks appears to be within the GeneralPDF.attach function. I can't figure out why though.&lt;/P&gt;&lt;BR /&gt;</description>
    <pubDate>Tue, 03 Jan 2017 00:42:18 GMT</pubDate>
    <dc:creator>stevejarman</dc:creator>
    <dc:date>2017-01-03T00:42:18Z</dc:date>
    <item>
      <title>PDF Generation in Geneva</title>
      <link>https://www.servicenow.com/community/developer-forum/pdf-generation-in-geneva/m-p/1751071#M407997</link>
      <description>&lt;P style="text-align: justify;"&gt;&lt;SPAN style="font-family: Calibri;"&gt;This document will cover details on PDF Generator Plugin provided in Geneva as well as Enhancement that I have made to this solution.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;SPAN style="font-family: Calibri;"&gt;1. &lt;/SPAN&gt;&lt;SPAN style="font-family: Calibri; color: #2e2e2e;"&gt;PDF Generator Plugin&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="text-align: justify;"&gt;&lt;SPAN style="font-family: Calibri;"&gt;PDF generation feature has been added in Geneva as plugin, which provides the ability to generate PDF documents as per your own layout and data.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" cellpadding="0" cellspacing="0" height="72" style="border: none; width: 841px; height: 72px; background: white;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD style="border: solid windowtext 1.0pt; padding: 6.0pt 6.0pt 6.0pt 6.0pt;" valign="top" width="24%"&gt;&lt;P style="text-align: justify;"&gt;&lt;SPAN style="font-family: Calibri; color: #2e2e2e;"&gt;PDF Generator&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="text-align: justify;"&gt;&lt;SPAN style="color: #2e2e2e; font-family: Calibri;"&gt;&lt;STRONG&gt;New in Geneva application&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border: solid windowtext 1.0pt; border-left: none; padding: 6.0pt 6.0pt 6.0pt 6.0pt;" valign="top" width="29%"&gt;&lt;P&gt;&lt;SPAN style="font-family: Calibri; color: #2e2e2e;"&gt;com.snc.pdf_generator&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border: solid windowtext 1.0pt; border-left: none; padding: 6.0pt 6.0pt 6.0pt 6.0pt;" valign="top" width="45%"&gt;&lt;P style="text-align: justify;"&gt;&lt;SPAN style="font-family: Calibri; color: #2e2e2e;"&gt;Provides a tool to generate PDF documents.&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="text-align: justify;"&gt;&lt;SPAN style="font-family: Calibri;"&gt;This plugin has been used in Human Resources application to generate 'Employee Verification Letters' which is covered in &lt;A title="ocs.servicenow.com/bundle/geneva-service-management-for-the-enterprise/page/product/human_resources/task/t_ConfigEmployVerifLetter.html" href="https://docs.servicenow.com/bundle/geneva-service-management-for-the-enterprise/page/product/human_resources/task/t_ConfigEmployVerifLetter.html"&gt;Configure the employment verification letter&lt;/A&gt; and &lt;A title="ocs.servicenow.com/bundle/geneva-service-management-for-the-enterprise/page/product/human_resources/task/t_CompEmployVerifReq.html" href="https://docs.servicenow.com/bundle/geneva-service-management-for-the-enterprise/page/product/human_resources/task/t_CompEmployVerifReq.html"&gt;Complete an employment verification request&lt;/A&gt; articles in Geneva documentation.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="text-align: justify;"&gt;&lt;SPAN style="font-family: Calibri;"&gt;However documentation lacks the details on use of this plugin for any other custom application or OOTB tables i.e. Incidents etc. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="text-align: justify;"&gt;&lt;SPAN style="font-family: Calibri;"&gt;If you have been familiar with &lt;A title="walter.brame" __default_attr="22883" __jive_macro_name="user" class="jive_macro jive_macro_user" data-orig-content="walter.brame" data-renderedposition="314_179.703125_95_17" href="https://www.servicenow.com/community?id=community_user_profile&amp;amp;user=53cf4221db581fc09c9ffb651f9619f7"&gt;walter.brame&lt;/A&gt;'s (fantastic) PDF Generator, this plugin is based on the same scripts. Basically this plugin provides you the ability to generate PDF of any document i.e. Letter which an end user can draft &amp;amp; design in ServiceNow with the data coming form record it is related to.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="text-align: justify;"&gt;&lt;SPAN style="font-family: Calibri;"&gt;In order to utilize this for your application, you will need to create a script include similar to 'GeneralHRForm' and a document template table similar to 'hr_document_template' (both introduced with HR application in Geneva).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="text-align: justify;"&gt;&lt;SPAN style="font-family: Calibri;"&gt;In Script Include you would be able to configure various aspects of this solution including variables which need to be replaced while PDF generation and document template table keeps all the customized templates which you could format as per your need using HTML editor.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="text-align: justify;"&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif;"&gt;Figure 1 - HR Document Template Record &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="Pasted_Image_4_21_16__11_38_AM.png"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/203228iA358CA475AA76BD4/image-size/large?v=v2&amp;amp;px=999" srcset="/community/image/serverpage/image-id/203228iA358CA475AA76BD4/image-size/large?v=v2&amp;amp;px=999 1.0x" role="button" title="Pasted_Image_4_21_16__11_38_AM.png" alt="Pasted_Image_4_21_16__11_38_AM.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="text-align: justify;"&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif;"&gt;Figure 2 - PDF Letter Generated&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="text-align: justify;"&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="Pasted_Image_4_21_16__11_42_AM.png"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/203236i524FD234FD3B8E76/image-size/large?v=v2&amp;amp;px=999" srcset="/community/image/serverpage/image-id/203236i524FD234FD3B8E76/image-size/large?v=v2&amp;amp;px=999 1.0x" role="button" title="Pasted_Image_4_21_16__11_42_AM.png" alt="Pasted_Image_4_21_16__11_42_AM.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="text-align: justify;"&gt;&lt;/P&gt;&lt;P style="text-align: justify;"&gt;&lt;SPAN style="font-family: Calibri;"&gt;This solution has some limitations around variables you could use in templates as well as some other aspects. While working on it for a customer I have come up with some enhancements, which I would like to share with you in next section.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;SPAN style="font-family: Calibri;"&gt;2. &lt;/SPAN&gt;&lt;SPAN style="font-family: Calibri; color: #2e2e2e;"&gt;Enhancements &lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="text-align: justify;"&gt;&lt;SPAN style="font-family: Calibri;"&gt;If you are looking to implement PDF letter generation functionality using solution provided for 'Employee Verification Letter' in HR Application, you would find few limitations and I have developed following enhancements to it.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="text-align: justify;"&gt;&lt;STRONG&gt;&lt;SPAN style="font-family: Calibri;"&gt;a) &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-family: Calibri;"&gt;Dynamic Variables Parsing&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="text-align: justify;"&gt;&lt;SPAN style="; text-decoration: underline; font-family: Calibri;"&gt;&lt;STRONG&gt;Problem&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="text-align: justify;"&gt;&lt;SPAN style="font-family: Calibri;"&gt;When you are configuring document template you would notice that variables are being entered as {{Name]}} or {{Position}}. These variables are parsed by following method in 'GeneralHRForm' script include.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; text-align: justify;"&gt;Figure 3 - OOTB Script Include Method&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="javascript" __jive_macro_name="code" class="_jivemacro_uid_1461203592845818 jive_macro_code jive_text_macro" data-renderedposition="1680_8_1192_557" jivemacro_uid="_1461203592845818"&gt;&lt;P style="padding: 1.0pt 4.0pt 1.0pt 4.0pt;"&gt;&lt;SPAN style="font-size: 7.0pt; font-family: Courier;"&gt;parseBody : function(docBody, instance){&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding: 1.0pt 4.0pt 1.0pt 4.0pt;"&gt;&lt;SPAN style="font-size: 7.0pt; font-family: Courier;"&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var parsedBody = docBody;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding: 1.0pt 4.0pt 1.0pt 4.0pt;"&gt;&lt;SPAN style="font-size: 7.0pt; font-family: Courier;"&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var gr = new GlideRecord(this.tableName);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding: 1.0pt 4.0pt 1.0pt 4.0pt;"&gt;&lt;SPAN style="font-size: 7.0pt; font-family: Courier;"&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; gr.get(this.tableId);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding: 1.0pt 4.0pt 1.0pt 4.0pt;"&gt;&lt;SPAN style="font-size: 7.0pt; font-family: Courier;"&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding: 1.0pt 4.0pt 1.0pt 4.0pt;"&gt;&lt;SPAN style="font-size: 7.0pt; font-family: Courier;"&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var date = gs.now();&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding: 1.0pt 4.0pt 1.0pt 4.0pt;"&gt;&lt;SPAN style="font-size: 7.0pt; font-family: Courier;"&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; parsedBody = parsedBody.replace(/\{\{Date\}\}/gi, date);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding: 1.0pt 4.0pt 1.0pt 4.0pt;"&gt;&lt;SPAN style="font-size: 7.0pt; font-family: Courier;"&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; parsedBody = parsedBody.replace(/\{\{Name\}\}/gi, gr.hr_profile.name);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding: 1.0pt 4.0pt 1.0pt 4.0pt;"&gt;&lt;SPAN style="font-size: 7.0pt; font-family: Courier;"&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; parsedBody = parsedBody.replace(/\{\{Position\}\}/gi, gr.hr_profile.position.position);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding: 1.0pt 4.0pt 1.0pt 4.0pt;"&gt;&lt;SPAN style="font-size: 7.0pt; font-family: Courier;"&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; parsedBody = parsedBody.replace(/\{\{Time type\}\}/gi, gr.hr_profile.time_type.getDisplayValue());&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding: 1.0pt 4.0pt 1.0pt 4.0pt;"&gt;&lt;SPAN style="font-size: 7.0pt; font-family: Courier;"&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; parsedBody = parsedBody.replace(/\{\{Employment start date\}\}/gi, gr.hr_profile.employment_start_date); &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding: 1.0pt 4.0pt 1.0pt 4.0pt;"&gt;&lt;SPAN style="font-size: 7.0pt; font-family: Courier;"&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding: 1.0pt 4.0pt 1.0pt 4.0pt;"&gt;&lt;SPAN style="font-size: 7.0pt; font-family: Courier;"&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; parsedBody = parsedBody.replace(/\{\{Work email\}\}/gi, gr.hr_profile.work_email);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding: 1.0pt 4.0pt 1.0pt 4.0pt;"&gt;&lt;SPAN style="font-size: 7.0pt; font-family: Courier;"&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; parsedBody = parsedBody.replace(/\{\{Work phone\}\}/gi, gr.hr_profile.work_phone);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding: 1.0pt 4.0pt 1.0pt 4.0pt;"&gt;&lt;SPAN style="font-size: 7.0pt; font-family: Courier;"&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; parsedBody = parsedBody.replace(/\{\{Prefix\}\}/gi, gr.hr_profile.introduction);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding: 1.0pt 4.0pt 1.0pt 4.0pt;"&gt;&lt;SPAN style="font-size: 7.0pt; font-family: Courier;"&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; parsedBody = parsedBody.replace(/\{\{Nationality\}\}/gi, gr.hr_profile.nationality);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding: 1.0pt 4.0pt 1.0pt 4.0pt;"&gt;&lt;SPAN style="font-size: 7.0pt; font-family: Courier;"&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; parsedBody = parsedBody.replace(/\{\{Manager\}\}/gi, gr.hr_profile.manager.name);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding: 1.0pt 4.0pt 1.0pt 4.0pt;"&gt;&lt;SPAN style="font-size: 7.0pt; font-family: Courier;"&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; parsedBody = parsedBody.replace(/\{\{Department\}\}/gi, gr.hr_profile.department.name);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding: 1.0pt 4.0pt 1.0pt 4.0pt;"&gt;&lt;SPAN style="font-size: 7.0pt; font-family: Courier;"&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; parsedBody = parsedBody.replace(/\{\{Employee number\}\}/gi, gr.hr_profile.employee_number);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding: 1.0pt 4.0pt 1.0pt 4.0pt;"&gt;&lt;SPAN style="font-size: 7.0pt; font-family: Courier;"&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; parsedBody = parsedBody.replace(/\{\{Employment status\}\}/gi, gr.hr_profile.employment_status);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding: 1.0pt 4.0pt 1.0pt 4.0pt;"&gt;&lt;SPAN style="font-size: 7.0pt; font-family: Courier;"&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; parsedBody = parsedBody.replace(/\{\{Employment type\}\}/gi, gr.hr_profile.employment_type);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding: 1.0pt 4.0pt 1.0pt 4.0pt;"&gt;&lt;SPAN style="font-size: 7.0pt; font-family: Courier;"&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; parsedBody = parsedBody.replace(/\{\{Gender\}\}/gi, gr.hr_profile.gender);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding: 1.0pt 4.0pt 1.0pt 4.0pt;"&gt;&lt;SPAN style="font-size: 7.0pt; font-family: Courier;"&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding: 1.0pt 4.0pt 1.0pt 4.0pt;"&gt;&lt;SPAN style="font-size: 7.0pt; font-family: Courier;"&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // convert to the right image path &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding: 1.0pt 4.0pt 1.0pt 4.0pt;"&gt;&lt;SPAN style="font-size: 7.0pt; font-family: Courier;"&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; parsedBody = parsedBody.replace(/\/sys_attachment.do\?sys_id=(\w{32})/gi, '/$1.iix');&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding: 1.0pt 4.0pt 1.0pt 4.0pt;"&gt;&lt;SPAN style="font-size: 7.0pt; font-family: Courier;"&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; parsedBody = parsedBody.replace(/\/sys_attachment.do\?sys_id&amp;amp;#61;(\w{32})/gi, '/$1.iix');&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding: 1.0pt 4.0pt 1.0pt 4.0pt;"&gt;&lt;SPAN style="font-size: 7.0pt; font-family: Courier;"&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; parsedBody = parsedBody.replace(/src="\//gi, 'src="' + instance);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding: 1.0pt 4.0pt 1.0pt 4.0pt;"&gt;&lt;SPAN style="font-size: 7.0pt; font-family: Courier;"&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return parsedBody;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding: 1.0pt 4.0pt 1.0pt 4.0pt;"&gt;&lt;SPAN style="font-size: 7.0pt; font-family: Courier;"&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }, &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;/PRE&gt;&lt;P style="text-align: justify;"&gt;&lt;SPAN style="font-family: Calibri;"&gt;You would notice that variable parsing is hard-coded in the method, which poses a limitation that user can only use variables that have parsing code available in script include method 'parseBody'. Any new variable would require code change and may result in recurring code maintenance job for System Administrators.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="text-align: justify;"&gt;&lt;SPAN style="; text-decoration: underline; font-family: Calibri;"&gt;&lt;STRONG&gt;Solution&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="text-align: justify;"&gt;&lt;SPAN style="font-family: Calibri;"&gt;For this solution lets consider we are developing Letter generation solution for an Incident record and have already created following script include and document template table.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="text-align: justify;"&gt;&lt;SPAN style="font-family: Calibri;"&gt;Script Include: &lt;STRONG&gt;GeneralIncidentForm &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="text-align: justify;"&gt;&lt;SPAN style="font-family: Calibri;"&gt;Document template table: &lt;STRONG&gt;x_snc_letters_letter_template&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="text-align: justify;"&gt;&lt;SPAN style="font-family: Calibri;"&gt;Now we need to follow below steps:&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="text-align: justify;"&gt;&lt;/P&gt;&lt;P style="text-align: justify;"&gt;&lt;SPAN style="font-family: Calibri;"&gt;&lt;STRONG&gt;Step 1:&lt;/STRONG&gt; Add a new field called 'Table' to the document template form as below:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif;"&gt;Figure 4 - Adding table field&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="Table___ServiceNow_Service_Management.png"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/203234i4572B99B481452AD/image-size/large?v=v2&amp;amp;px=999" srcset="/community/image/serverpage/image-id/203234i4572B99B481452AD/image-size/large?v=v2&amp;amp;px=999 1.0x" role="button" title="Table___ServiceNow_Service_Management.png" alt="Table___ServiceNow_Service_Management.png" /&gt;&lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="text-align: justify;"&gt;&lt;SPAN style="font-family: Calibri;"&gt;&lt;STRONG&gt;Step 2:&lt;/STRONG&gt; Changed field type for 'Body' field from 'HTML Translated' to 'HTML Script'.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="text-align: justify;"&gt;&lt;/P&gt;&lt;P style="text-align: justify;"&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif;"&gt;Figure 5 - Body field type change &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="text-align: justify;"&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="Pasted_Image_4_21_16__11_57_AM.png"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/203233iA62C02F5F29C0634/image-size/large?v=v2&amp;amp;px=999" srcset="/community/image/serverpage/image-id/203233iA62C02F5F29C0634/image-size/large?v=v2&amp;amp;px=999 1.0x" role="button" title="Pasted_Image_4_21_16__11_57_AM.png" alt="Pasted_Image_4_21_16__11_57_AM.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="text-align: justify;"&gt;&lt;SPAN style="font-family: Calibri;"&gt;&lt;STRONG&gt;Step 3:&lt;/STRONG&gt; Set 'Use dependent field' to checked and 'Dependent field' to 'Table' (i.e. new field you created)&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="text-align: justify;"&gt;&lt;/P&gt;&lt;P style="text-align: justify;"&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif;"&gt;Figure 6 - Setting dependent field &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="text-align: justify;"&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="Body___ServiceNow_Service_Management.png"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/203239iE3798242E115C927/image-size/large?v=v2&amp;amp;px=999" srcset="/community/image/serverpage/image-id/203239iE3798242E115C927/image-size/large?v=v2&amp;amp;px=999 1.0x" role="button" title="Body___ServiceNow_Service_Management.png" alt="Body___ServiceNow_Service_Management.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="text-align: justify;"&gt;&lt;/P&gt;&lt;P style="text-align: justify;"&gt;&lt;SPAN style="font-family: Calibri;"&gt;This will change your form to look like below:&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="text-align: justify;"&gt;&lt;/P&gt;&lt;P style="text-align: justify;"&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif;"&gt;Figure 7 - Enhanced document template form &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="text-align: justify;"&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="Incident_Notification_Letter___ServiceNow_Service_Management.png"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/203237i5BA0AF63D406D1DA/image-size/large?v=v2&amp;amp;px=999" srcset="/community/image/serverpage/image-id/203237i5BA0AF63D406D1DA/image-size/large?v=v2&amp;amp;px=999 1.0x" role="button" title="Incident_Notification_Letter___ServiceNow_Service_Management.png" alt="Incident_Notification_Letter___ServiceNow_Service_Management.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="text-align: justify;"&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="text-align: justify;"&gt;&lt;SPAN style="font-family: Calibri;"&gt;This form would now provide the similar functionality as we have for creating email templates i.e.&lt;/SPAN&gt;&lt;/P&gt;&lt;UL style="list-style-type: disc;"&gt;&lt;LI&gt;&lt;SPAN style="font-family: Calibri;"&gt;You can select table from the table dropdown, i.e. in this case 'Incident'&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="font-family: Calibri;"&gt;'Select variable' section on right of 'Body' field populates all the fields from Incident table (which was selected in table field above).&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="font-family: Calibri;"&gt;You can select any field from variable list, which would be added to template body.&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="font-family: Calibri;"&gt;You can drill down / dot-walk to a lower level of field and add it to the body.&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="font-family: Calibri;"&gt;Notice that variables are now enclosed in ${}.&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Calibri;"&gt;&lt;STRONG&gt;Step 4:&lt;/STRONG&gt; Now we need to modify script include to parse these variables dynamically. Replace the parseBody method with code given below: &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif;"&gt;Figure 8 - Enhanced Script Include Method &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="javascript" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14612044603101610 jive_text_macro" data-renderedposition="4478.8125_8_1192_797" jivemacro_uid="_14612044603101610"&gt;&lt;P style="padding: 1.0pt 4.0pt 1.0pt 4.0pt;"&gt;&lt;SPAN style="font-size: 7.0pt; font-family: Courier;"&gt;parseBody : function(docBody, instance){&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding: 1.0pt 4.0pt 1.0pt 4.0pt;"&gt;&lt;SPAN style="font-size: 7.0pt; font-family: Courier;"&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var parsedBody = docBody;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding: 1.0pt 4.0pt 1.0pt 4.0pt;"&gt;&lt;SPAN style="font-size: 7.0pt; font-family: Courier;"&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var gr = new GlideRecord(this.tableName);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding: 1.0pt 4.0pt 1.0pt 4.0pt;"&gt;&lt;SPAN style="font-size: 7.0pt; font-family: Courier;"&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; gr.get(this.tableId);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding: 1.0pt 4.0pt 1.0pt 4.0pt;"&gt;&lt;SPAN style="font-size: 7.0pt; font-family: Courier;"&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding: 1.0pt 4.0pt 1.0pt 4.0pt;"&gt;&lt;SPAN style="font-size: 7.0pt; font-family: Courier;"&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var date = gs.now();&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding: 1.0pt 4.0pt 1.0pt 4.0pt;"&gt;&lt;SPAN style="font-size: 7.0pt; font-family: Courier;"&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; parsedBody = parsedBody.replace(/\$\{date\}/gi, date);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding: 1.0pt 4.0pt 1.0pt 4.0pt;"&gt;&lt;SPAN style="font-size: 7.0pt; font-family: Courier;"&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; parsedBody = parsedBody.replace(/\$\{letterid\}/gi, this.letterid);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding: 1.0pt 4.0pt 1.0pt 4.0pt;"&gt;&lt;SPAN style="font-size: 7.0pt; font-family: Courier;"&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding: 1.0pt 4.0pt 1.0pt 4.0pt;"&gt;&lt;SPAN style="font-size: 7.0pt; font-family: Courier;"&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // parsing of variables dynamically&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding: 1.0pt 4.0pt 1.0pt 4.0pt;"&gt;&lt;SPAN style="font-size: 7.0pt; font-family: Courier;"&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var sampleString=docBody.toString();&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding: 1.0pt 4.0pt 1.0pt 4.0pt;"&gt;&lt;SPAN style="font-size: 7.0pt; font-family: Courier;"&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var reg = new SNC.Regex('/\\$\\{(.*?)\\}/i');&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding: 1.0pt 4.0pt 1.0pt 4.0pt;"&gt;&lt;SPAN style="font-size: 7.0pt; font-family: Courier;"&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var match = reg.match(sampleString);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding: 1.0pt 4.0pt 1.0pt 4.0pt;"&gt;&lt;SPAN style="font-size: 7.0pt; font-family: Courier;"&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var count =0;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding: 1.0pt 4.0pt 1.0pt 4.0pt;"&gt;&lt;SPAN style="font-size: 7.0pt; font-family: Courier;"&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var variables = [];&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding: 1.0pt 4.0pt 1.0pt 4.0pt;"&gt;&lt;SPAN style="font-size: 7.0pt; font-family: Courier;"&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var values = [];&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding: 1.0pt 4.0pt 1.0pt 4.0pt;"&gt;&lt;SPAN style="font-size: 7.0pt; font-family: Courier;"&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var tmpValue;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding: 1.0pt 4.0pt 1.0pt 4.0pt;"&gt;&lt;SPAN style="font-size: 7.0pt; font-family: Courier;"&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; while (match != null) {&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding: 1.0pt 4.0pt 1.0pt 4.0pt;"&gt;&lt;SPAN style="font-size: 7.0pt; font-family: Courier;"&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; variables.push(match.toString().substring(match.toString().indexOf(',')+1));&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding: 1.0pt 4.0pt 1.0pt 4.0pt;"&gt;&lt;SPAN style="font-size: 7.0pt; font-family: Courier;"&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; match = reg.match();&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding: 1.0pt 4.0pt 1.0pt 4.0pt;"&gt;&lt;SPAN style="font-size: 7.0pt; font-family: Courier;"&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding: 1.0pt 4.0pt 1.0pt 4.0pt;"&gt;&lt;SPAN style="font-size: 7.0pt; font-family: Courier;"&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; values.push(variables[count]);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding: 1.0pt 4.0pt 1.0pt 4.0pt;"&gt;&lt;SPAN style="font-size: 7.0pt; font-family: Courier;"&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if(gr.getDisplayValue(values[count])==null || JSUtil.nil(gr.getDisplayValue(values[count]))){&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding: 1.0pt 4.0pt 1.0pt 4.0pt;"&gt;&lt;SPAN style="font-size: 7.0pt; font-family: Courier;"&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; tmpValue='';&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding: 1.0pt 4.0pt 1.0pt 4.0pt;"&gt;&lt;SPAN style="font-size: 7.0pt; font-family: Courier;"&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding: 1.0pt 4.0pt 1.0pt 4.0pt;"&gt;&lt;SPAN style="font-size: 7.0pt; font-family: Courier;"&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; else&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding: 1.0pt 4.0pt 1.0pt 4.0pt;"&gt;&lt;SPAN style="font-size: 7.0pt; font-family: Courier;"&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding: 1.0pt 4.0pt 1.0pt 4.0pt;"&gt;&lt;SPAN style="font-size: 7.0pt; font-family: Courier;"&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; tmpValue=gr.getDisplayValue(values[count]);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding: 1.0pt 4.0pt 1.0pt 4.0pt;"&gt;&lt;SPAN style="font-size: 7.0pt; font-family: Courier;"&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding: 1.0pt 4.0pt 1.0pt 4.0pt;"&gt;&lt;SPAN style="font-size: 7.0pt; font-family: Courier;"&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding: 1.0pt 4.0pt 1.0pt 4.0pt;"&gt;&lt;SPAN style="font-size: 7.0pt; font-family: Courier;"&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; parsedBody = parsedBody.replace('${'+variables[count]+'}', tmpValue);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding: 1.0pt 4.0pt 1.0pt 4.0pt;"&gt;&lt;SPAN style="font-size: 7.0pt; font-family: Courier;"&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; count++;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding: 1.0pt 4.0pt 1.0pt 4.0pt;"&gt;&lt;SPAN style="font-size: 7.0pt; font-family: Courier;"&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding: 1.0pt 4.0pt 1.0pt 4.0pt;"&gt;&lt;SPAN style="font-size: 7.0pt; font-family: Courier;"&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding: 1.0pt 4.0pt 1.0pt 4.0pt;"&gt;&lt;SPAN style="font-size: 7.0pt; font-family: Courier;"&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // convert to the right image path&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding: 1.0pt 4.0pt 1.0pt 4.0pt;"&gt;&lt;SPAN style="font-size: 7.0pt; font-family: Courier;"&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; parsedBody = parsedBody.replace(/\/sys_attachment.do\?sys_id=(\w{32})/gi, '/$1.iix');&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding: 1.0pt 4.0pt 1.0pt 4.0pt;"&gt;&lt;SPAN style="font-size: 7.0pt; font-family: Courier;"&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; parsedBody = parsedBody.replace(/\/sys_attachment.do\?sys_id&amp;amp;#61;(\w{32})/gi, '/$1.iix');&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding: 1.0pt 4.0pt 1.0pt 4.0pt;"&gt;&lt;SPAN style="font-size: 7.0pt; font-family: Courier;"&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; parsedBody = parsedBody.replace(/src="\//gi, 'src="' + instance);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding: 1.0pt 4.0pt 1.0pt 4.0pt;"&gt;&lt;SPAN style="font-size: 7.0pt; font-family: Courier;"&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding: 1.0pt 4.0pt 1.0pt 4.0pt;"&gt;&lt;SPAN style="font-size: 7.0pt; font-family: Courier;"&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return parsedBody;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding: 1.0pt 4.0pt 1.0pt 4.0pt;"&gt;&lt;SPAN style="font-size: 7.0pt; font-family: Courier;"&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }, &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: calibri, verdana, arial, sans-serif;"&gt;And when you generate PDF, solution would be able to parse any variable you &lt;/SPAN&gt;&lt;SPAN style="font-family: Calibri;"&gt;have included in the document template. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Calibri;"&gt;Here is the out put.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif;"&gt;Figure 9 - Final generated letter &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="final.png"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/203238i3EADF5FCD5807D44/image-size/large?v=v2&amp;amp;px=999" srcset="/community/image/serverpage/image-id/203238i3EADF5FCD5807D44/image-size/large?v=v2&amp;amp;px=999 1.0x" role="button" title="final.png" alt="final.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;SPAN style="font-family: Calibri;"&gt;b) &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-family: Calibri;"&gt;Miscellaneous enhancements &lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="text-align: justify;"&gt;&lt;SPAN style="font-family: Calibri;"&gt;Following minor enhancements were also made and are included in attached script include code. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Calibri;"&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; i) &lt;/SPAN&gt;&lt;SPAN style="font-family: Calibri;"&gt;Removal of hard coded references for template table and source table form script include and passing them as parameter.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Calibri;"&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ii) &lt;/SPAN&gt;&lt;SPAN style="font-family: Calibri;"&gt;Setting file name in script include as you like.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Calibri;"&gt;&lt;SPAN style="font-family: Calibri;"&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; iii) &lt;/SPAN&gt;&lt;SPAN style="font-family: Calibri;"&gt;and couple of more.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="text-align: justify;"&gt;&lt;SPAN style="font-family: Calibri;"&gt;Apart from this I have also developed a solution of 'Letters &amp;amp; Correspondence Management' which covers:&lt;/SPAN&gt;&lt;/P&gt;&lt;UL style="list-style-type: disc;"&gt;&lt;LI&gt;&lt;SPAN style="font-family: Calibri;"&gt;Creating draft letter, approval and then generation of PDF&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="font-family: Calibri;"&gt;Having ability to select from multiple pre-drafted letter templates&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="font-family: Calibri;"&gt;Ability to generate latter / template with data coming from any ServiceNow table.&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="font-family: Calibri;"&gt;and more.&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="text-align: justify;"&gt;&lt;SPAN style="font-family: Calibri;"&gt;This solution will be available on Share portal soon.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="text-align: justify;"&gt;&lt;/P&gt;&lt;P style="text-align: justify;"&gt;&lt;SPAN style="font-family: Calibri;"&gt;Please share your feedback on this solution and how could this be improved.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Syed Faheem&lt;/P&gt;</description>
      <pubDate>Thu, 21 Apr 2016 01:40:45 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/pdf-generation-in-geneva/m-p/1751071#M407997</guid>
      <dc:creator>syed_faheem</dc:creator>
      <dc:date>2016-04-21T01:40:45Z</dc:date>
    </item>
    <item>
      <title>Re: PDF Generation in Geneva</title>
      <link>https://www.servicenow.com/community/developer-forum/pdf-generation-in-geneva/m-p/1751072#M407998</link>
      <description>&lt;P&gt;Hi Syed,&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;The HTML script type is not available OOB as a field type from object class. There are ways to make it available although trying that does not always work- I tried this on my personal dev instance and it corrupted the body field on the custom form ( Letters Template) &lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Anything I put inside the body does not get saved .&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="find_real_file.png"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/203222i53ED32B8315B1AC3/image-size/large?v=v2&amp;amp;px=999" srcset="/community/image/serverpage/image-id/203222i53ED32B8315B1AC3/image-size/large?v=v2&amp;amp;px=999 1.0x" role="button" title="find_real_file.png" alt="find_real_file.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Amit&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 28 Apr 2016 03:49:09 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/pdf-generation-in-geneva/m-p/1751072#M407998</guid>
      <dc:creator>amitpatil</dc:creator>
      <dc:date>2016-04-28T03:49:09Z</dc:date>
    </item>
    <item>
      <title>Re: PDF Generation in Geneva</title>
      <link>https://www.servicenow.com/community/developer-forum/pdf-generation-in-geneva/m-p/1751073#M407999</link>
      <description>&lt;P&gt;Hi Amit,&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Try deleting the field and recreate it. &lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 29 Apr 2016 02:08:32 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/pdf-generation-in-geneva/m-p/1751073#M407999</guid>
      <dc:creator>syed_faheem</dc:creator>
      <dc:date>2016-04-29T02:08:32Z</dc:date>
    </item>
    <item>
      <title>Re: PDF Generation in Geneva</title>
      <link>https://www.servicenow.com/community/developer-forum/pdf-generation-in-geneva/m-p/1751074#M408000</link>
      <description>&lt;P&gt;Thanks Syed.&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Calibri',sans-serif; color: #1f497d;"&gt;After I faced this issue I deleted the custom table and created a new one which extends the existing hr_document_template table. After this I made the changes you suggested. The form is ok now. I just need to get the pdf generated now .I have imported the script include you wrote ( as part of the zip file ) . I tried calling it using a UI action on incident although it does not generate the PDF.&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Calibri',sans-serif; color: #1f497d;"&gt;Can you please share the UI action as well?&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Calibri',sans-serif; color: #1f497d;"&gt;Thanks ,&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Calibri',sans-serif; color: #1f497d;"&gt;Amit&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 29 Apr 2016 04:21:37 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/pdf-generation-in-geneva/m-p/1751074#M408000</guid>
      <dc:creator>amitpatil</dc:creator>
      <dc:date>2016-04-29T04:21:37Z</dc:date>
    </item>
    <item>
      <title>Re: PDF Generation in Geneva</title>
      <link>https://www.servicenow.com/community/developer-forum/pdf-generation-in-geneva/m-p/1751075#M408001</link>
      <description>&lt;P&gt;Hi Amit,&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Please use below code to call script include in your UI action.&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;// setting parameter values&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;var tempTable='x_snc_letters_letter_template';&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;var tempName='Incident Notification Letter';&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;var sourceTable= current.getTableName();&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;// calling script include function&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;global.GeneralIncidentForm.generate(current.sys_id, sourceTable, tempTable, tempName);&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;action.setRedirectURL(current);&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 29 Apr 2016 04:51:04 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/pdf-generation-in-geneva/m-p/1751075#M408001</guid>
      <dc:creator>syed_faheem</dc:creator>
      <dc:date>2016-04-29T04:51:04Z</dc:date>
    </item>
    <item>
      <title>Re: PDF Generation in Geneva</title>
      <link>https://www.servicenow.com/community/developer-forum/pdf-generation-in-geneva/m-p/1751076#M408002</link>
      <description>&lt;P&gt;Thanks a lot Syed !&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;It generates the PDF now. I had to create 'Name' field on the 'Letters template' as it is being verified to generate the letter.&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;The generated letter come with the name 'Employee Verification Letter for Undefined' as shown below. Any clue? The content is fine though.&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="find_real_file.png"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/203226i662F79549EDE4C9E/image-size/large?v=v2&amp;amp;px=999" srcset="/community/image/serverpage/image-id/203226i662F79549EDE4C9E/image-size/large?v=v2&amp;amp;px=999 1.0x" role="button" title="find_real_file.png" alt="find_real_file.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 29 Apr 2016 06:40:02 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/pdf-generation-in-geneva/m-p/1751076#M408002</guid>
      <dc:creator>amitpatil</dc:creator>
      <dc:date>2016-04-29T06:40:02Z</dc:date>
    </item>
    <item>
      <title>Re: PDF Generation in Geneva</title>
      <link>https://www.servicenow.com/community/developer-forum/pdf-generation-in-geneva/m-p/1751077#M408003</link>
      <description>&lt;P&gt;Hi Amit,&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;File name is being set line 158 of script include GeneraForm as below&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;this.fileName = 'Employee Verification Letter for ' + this.glideRecord.opened_for.name; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;you can modify this here.&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Syed.&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Sun, 01 May 2016 01:26:07 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/pdf-generation-in-geneva/m-p/1751077#M408003</guid>
      <dc:creator>syed_faheem</dc:creator>
      <dc:date>2016-05-01T01:26:07Z</dc:date>
    </item>
    <item>
      <title>Re: PDF Generation in Geneva</title>
      <link>https://www.servicenow.com/community/developer-forum/pdf-generation-in-geneva/m-p/1751078#M408004</link>
      <description>&lt;P&gt;Hello Syed,&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;I was wondering how is it possible to make the 'HTML Script' available as a file type?&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 04 May 2016 19:37:47 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/pdf-generation-in-geneva/m-p/1751078#M408004</guid>
      <dc:creator>sergiogomez</dc:creator>
      <dc:date>2016-05-04T19:37:47Z</dc:date>
    </item>
    <item>
      <title>Re: PDF Generation in Geneva</title>
      <link>https://www.servicenow.com/community/developer-forum/pdf-generation-in-geneva/m-p/1751079#M408005</link>
      <description>&lt;P&gt;&lt;SPAN style="font-size: 11.5pt; font-family: 'Arial',sans-serif; color: black;"&gt;Hi Sergio , Please try following ( at your own risk ! This approach is not recommended by servicenow .One of my colleagues shared it with me )&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.5pt; font-family: 'Arial',sans-serif; color: black;"&gt;&lt;BR /&gt;Change the Reference Qualifier of the 'Reference \ internal_type' field in the 'Dictionary Entry \ sys_dictionary' table.&lt;BR /&gt; &lt;BR /&gt;The attached screenshot shows the OOB field setup.&lt;BR /&gt; &lt;BR /&gt;Simply modify the 'Use reference qualifier' field to 'Simple', leave everything else as it is, and Save the record.&lt;BR /&gt; &lt;BR /&gt;You can now create fields of many more field-types.&lt;BR /&gt; &lt;BR /&gt;Maybe best-practice is to change the Reference Qualifier back to how it was originally.&lt;BR /&gt; &lt;BR /&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.5pt; font-family: 'Arial',sans-serif; color: black;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="find_real_file.png"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/203231i09E40F499C8C98EB/image-size/large?v=v2&amp;amp;px=999" srcset="/community/image/serverpage/image-id/203231i09E40F499C8C98EB/image-size/large?v=v2&amp;amp;px=999 1.0x" role="button" title="find_real_file.png" alt="find_real_file.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 06 May 2016 03:18:32 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/pdf-generation-in-geneva/m-p/1751079#M408005</guid>
      <dc:creator>amitpatil</dc:creator>
      <dc:date>2016-05-06T03:18:32Z</dc:date>
    </item>
    <item>
      <title>Re: PDF Generation in Geneva</title>
      <link>https://www.servicenow.com/community/developer-forum/pdf-generation-in-geneva/m-p/1751080#M408006</link>
      <description>&lt;P&gt;Hi Syed,&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Thanks for responding to my query.&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Changing the file name in GeneralForm will fix the issue although may be for Incident Letter. Is there any way that this can be made dynamic ?&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Curious to know why it is not &amp;nbsp; picking up the file name from the script include .&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;generalForm.start(); calls in the GeneralForm script include and that's why it sets the name as 'Employee Verification Letter...' &lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;But then I did not understand why generaHRForm.start(); is there for... Also if we have _getDocTempleInfo function which sets the file name , why it is not being applied ( as specified above that it will overwrite the functions from other scripts?)&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Amit&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 06 May 2016 03:27:06 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/pdf-generation-in-geneva/m-p/1751080#M408006</guid>
      <dc:creator>amitpatil</dc:creator>
      <dc:date>2016-05-06T03:27:06Z</dc:date>
    </item>
    <item>
      <title>Re: PDF Generation in Geneva</title>
      <link>https://www.servicenow.com/community/developer-forum/pdf-generation-in-geneva/m-p/1751081#M408007</link>
      <description>&lt;P&gt;Thank you very much, I will try that (at my own risk &lt;SPAN __jive_emoticon_name="happy" __jive_macro_name="emoticon" class="jive_emote jive_macro" data-renderedposition="8_332_16_16" src="https://www.servicenow.com/8.0.1.35b65d4/images/emoticons/happy.png"&gt;&lt;/SPAN&gt; )&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 06 May 2016 20:09:45 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/pdf-generation-in-geneva/m-p/1751081#M408007</guid>
      <dc:creator>sergiogomez</dc:creator>
      <dc:date>2016-05-06T20:09:45Z</dc:date>
    </item>
    <item>
      <title>Re: PDF Generation in Geneva</title>
      <link>https://www.servicenow.com/community/developer-forum/pdf-generation-in-geneva/m-p/1751082#M408008</link>
      <description>&lt;P&gt;Hi Syed,&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Thats a nice enhancement! A tad easier to edit the document template now.&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;I have tried to insert pagebreaks in a document, but i can't figure out how. There are lot of references to pagebreaks, newDocument page_break, etc. in the various script includes.&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Do you how to insert forced page breaks?&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 10 May 2016 10:49:02 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/pdf-generation-in-geneva/m-p/1751082#M408008</guid>
      <dc:creator>kentespenhain</dc:creator>
      <dc:date>2016-05-10T10:49:02Z</dc:date>
    </item>
    <item>
      <title>Re: PDF Generation in Geneva</title>
      <link>https://www.servicenow.com/community/developer-forum/pdf-generation-in-geneva/m-p/1751083#M408009</link>
      <description>&lt;P&gt;can you please provide more information on creating table &amp;nbsp; and where to find HTML Script field i found HTML and HTML Translated &lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 10 May 2016 18:11:22 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/pdf-generation-in-geneva/m-p/1751083#M408009</guid>
      <dc:creator>bhavu81</dc:creator>
      <dc:date>2016-05-10T18:11:22Z</dc:date>
    </item>
    <item>
      <title>Re: PDF Generation in Geneva</title>
      <link>https://www.servicenow.com/community/developer-forum/pdf-generation-in-geneva/m-p/1751084#M408010</link>
      <description>&lt;P&gt;Hi Bhavana,&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;If you have HR plugin installed on your geneva instance, you can extend table or create a similar table to 'hr_document_template' to create your template table.&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;To enable HTML Script field please follow the process &lt;A title="amitpatil" __default_attr="50373" __jive_macro_name="user" class="jive-link-profile-small jive_macro jive_macro_user" data-id="50373" data-objecttype="3" data-orig-content="amitpatil" data-renderedposition="73_348.15625_73_16" data-type="person" href="https://www.servicenow.com/community?id=community_user_profile&amp;amp;user=1cc3126ddb1c1fc09c9ffb651f96194e"&gt;amitpatil&lt;/A&gt; mentioned above on May 6, 2016 1:18 PM.&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Syed&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 11 May 2016 23:58:50 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/pdf-generation-in-geneva/m-p/1751084#M408010</guid>
      <dc:creator>syed_faheem</dc:creator>
      <dc:date>2016-05-11T23:58:50Z</dc:date>
    </item>
    <item>
      <title>Re: PDF Generation in Geneva</title>
      <link>https://www.servicenow.com/community/developer-forum/pdf-generation-in-geneva/m-p/1751085#M408011</link>
      <description>&lt;P&gt;Hi &lt;A title="kentespenhain" __default_attr="37868" __jive_macro_name="user" class="jive-link-profile-small jive_macro jive_macro_user" data-id="37868" data-objecttype="3" data-orig-content="kentespenhain" data-renderedposition="10_25.09375_111_16" data-type="person" href="https://www.servicenow.com/community?id=community_user_profile&amp;amp;user=952f0e25db181fc09c9ffb651f961902"&gt;kentespenhain&lt;/A&gt; &lt;/P&gt;&lt;BR /&gt;&lt;P&gt;I have not tried inserting Page Breaks via code, however i have tried to insert page break in the document template via HTML code which wasn't successful. Apparently HTML scripts we have in geneva does not fully cater for HTML codes, i.e. you cant set background colour and have it printed in PDF. &lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Its worth exploring what we can do in terms of page break, if you find any solution please share it here &lt;SPAN __jive_emoticon_name="happy" __jive_macro_name="emoticon" class="jive_emote jive_macro" data-renderedposition="92_649.484375_16_16" src="https://www.servicenow.com/8.0.1.35b65d4/images/emoticons/happy.png"&gt;&lt;/SPAN&gt;.&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Syed.&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 12 May 2016 00:06:41 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/pdf-generation-in-geneva/m-p/1751085#M408011</guid>
      <dc:creator>syed_faheem</dc:creator>
      <dc:date>2016-05-12T00:06:41Z</dc:date>
    </item>
    <item>
      <title>Re: PDF Generation in Geneva</title>
      <link>https://www.servicenow.com/community/developer-forum/pdf-generation-in-geneva/m-p/1751086#M408012</link>
      <description>&lt;P&gt;I took at "step back" and looked at Walter Brames version.&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;In the &lt;EM&gt;Generalform2&lt;/EM&gt; Script include&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;"&lt;SPAN class="Apple-tab-span" style="white-space: pre;"&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;SPAN class="Apple-tab-span" style="white-space: pre;"&gt; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;if (table.html.indexOf('{!Page_Break}') != -1) {&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;SPAN class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/SPAN&gt;table.html = table.html.replaceAll('{!Page_Break}', '');&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;SPAN class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/SPAN&gt;this.document.&lt;STRONG&gt;document.newPage(); &lt;/STRONG&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;SPAN class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/SPAN&gt;}&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;"&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;However i wasent't able to get it to work properly. &lt;span class="lia-unicode-emoji" title=":confused_face:"&gt;😕&lt;/span&gt;&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 12 May 2016 11:33:54 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/pdf-generation-in-geneva/m-p/1751086#M408012</guid>
      <dc:creator>kentespenhain</dc:creator>
      <dc:date>2016-05-12T11:33:54Z</dc:date>
    </item>
    <item>
      <title>Re: PDF Generation in Geneva</title>
      <link>https://www.servicenow.com/community/developer-forum/pdf-generation-in-geneva/m-p/1751087#M408013</link>
      <description>&lt;P&gt;Thank you Syed but currently i am trying on Geneva demo service now version &lt;/P&gt;&lt;BR /&gt;&lt;P&gt;v have eureka but will be upgrading soon then i can try on our own instance&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 12 May 2016 13:02:03 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/pdf-generation-in-geneva/m-p/1751087#M408013</guid>
      <dc:creator>bhavu81</dc:creator>
      <dc:date>2016-05-12T13:02:03Z</dc:date>
    </item>
    <item>
      <title>Re: PDF Generation in Geneva</title>
      <link>https://www.servicenow.com/community/developer-forum/pdf-generation-in-geneva/m-p/1751088#M408014</link>
      <description>&lt;P&gt;Hi Syed ,&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;i am trying to call this script within pdf template is it possible??&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;SPAN style="font-size: 11px; font-family: Monaco, 'Lucida Console', monospace; color: #339933; background-position: initial;"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Monaco, 'Lucida Console', monospace; font-size: 11px; background-color: #f1f1f1;"&gt;mail_script&lt;/SPAN&gt;&lt;SPAN style="font-size: 11px; font-family: Monaco, 'Lucida Console', monospace; color: #339933; background-position: initial;"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Monaco, 'Lucida Console', monospace; font-size: 11px; background-color: #f1f1f1;"&gt;attachLinks&lt;/SPAN&gt;&lt;SPAN style="font-size: 11px; font-family: Monaco, 'Lucida Console', monospace; color: #009900; background-position: initial;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-size: 11px; font-family: Monaco, 'Lucida Console', monospace; color: #009900; background-position: initial;"&gt;)&lt;/SPAN&gt;&lt;SPAN style="font-size: 11px; font-family: Monaco, 'Lucida Console', monospace; color: #339933; background-position: initial;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;SPAN style="font-size: 11px; font-weight: bold; font-family: Monaco, 'Lucida Console', monospace; color: #003366; background-position: initial;"&gt;function&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Monaco, 'Lucida Console', monospace; font-size: 11px; background-color: #f1f1f1;"&gt; attachLinks&lt;/SPAN&gt;&lt;SPAN style="font-size: 11px; font-family: Monaco, 'Lucida Console', monospace; color: #009900; background-position: initial;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-size: 11px; font-family: Monaco, 'Lucida Console', monospace; color: #009900; background-position: initial;"&gt;)&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Monaco, 'Lucida Console', monospace; font-size: 11px; background-color: #f1f1f1;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 11px; font-family: Monaco, 'Lucida Console', monospace; color: #009900; background-position: initial;"&gt;{&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Monaco, 'Lucida Console', monospace; font-size: 11px; background-color: #f1f1f1;"&gt; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-size: 11px; font-style: italic; font-family: Monaco, 'Lucida Console', monospace; color: #006600; background-position: initial;"&gt;//Check for any attachments and add attachment links if they exist&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Monaco, 'Lucida Console', monospace; font-size: 11px; background-color: #f1f1f1;"&gt; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-size: 11px; font-weight: bold; font-family: Monaco, 'Lucida Console', monospace; color: #003366; background-position: initial;"&gt;var&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Monaco, 'Lucida Console', monospace; font-size: 11px; background-color: #f1f1f1;"&gt; gr &lt;/SPAN&gt;&lt;SPAN style="font-size: 11px; font-family: Monaco, 'Lucida Console', monospace; color: #339933; background-position: initial;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Monaco, 'Lucida Console', monospace; font-size: 11px; background-color: #f1f1f1;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 11px; font-weight: bold; font-family: Monaco, 'Lucida Console', monospace; color: #003366; background-position: initial;"&gt;new&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Monaco, 'Lucida Console', monospace; font-size: 11px; background-color: #f1f1f1;"&gt; GlideRecord&lt;/SPAN&gt;&lt;SPAN style="font-size: 11px; font-family: Monaco, 'Lucida Console', monospace; color: #009900; background-position: initial;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-size: 11px; font-family: Monaco, 'Lucida Console', monospace; color: #3366cc; background-position: initial;"&gt;'sys_attachment'&lt;/SPAN&gt;&lt;SPAN style="font-size: 11px; font-family: Monaco, 'Lucida Console', monospace; color: #009900; background-position: initial;"&gt;)&lt;/SPAN&gt;&lt;SPAN style="font-size: 11px; font-family: Monaco, 'Lucida Console', monospace; color: #339933; background-position: initial;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Monaco, 'Lucida Console', monospace; font-size: 11px; background-color: #f1f1f1;"&gt; &amp;nbsp; &amp;nbsp; gr.&lt;/SPAN&gt;&lt;SPAN style="font-size: 11px; font-family: Monaco, 'Lucida Console', monospace; color: #660066; background-position: initial;"&gt;addQuery&lt;/SPAN&gt;&lt;SPAN style="font-size: 11px; font-family: Monaco, 'Lucida Console', monospace; color: #009900; background-position: initial;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-size: 11px; font-family: Monaco, 'Lucida Console', monospace; color: #3366cc; background-position: initial;"&gt;'table_sys_id'&lt;/SPAN&gt;&lt;SPAN style="font-size: 11px; font-family: Monaco, 'Lucida Console', monospace; color: #339933; background-position: initial;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Monaco, 'Lucida Console', monospace; font-size: 11px; background-color: #f1f1f1;"&gt;current.&lt;/SPAN&gt;&lt;SPAN style="font-size: 11px; font-family: Monaco, 'Lucida Console', monospace; color: #660066; background-position: initial;"&gt;sys_id&lt;/SPAN&gt;&lt;SPAN style="font-size: 11px; font-family: Monaco, 'Lucida Console', monospace; color: #009900; background-position: initial;"&gt;)&lt;/SPAN&gt;&lt;SPAN style="font-size: 11px; font-family: Monaco, 'Lucida Console', monospace; color: #339933; background-position: initial;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Monaco, 'Lucida Console', monospace; font-size: 11px; background-color: #f1f1f1;"&gt; &amp;nbsp; &amp;nbsp; gr.&lt;/SPAN&gt;&lt;SPAN style="font-size: 11px; font-family: Monaco, 'Lucida Console', monospace; color: #660066; background-position: initial;"&gt;query&lt;/SPAN&gt;&lt;SPAN style="font-size: 11px; font-family: Monaco, 'Lucida Console', monospace; color: #009900; background-position: initial;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-size: 11px; font-family: Monaco, 'Lucida Console', monospace; color: #009900; background-position: initial;"&gt;)&lt;/SPAN&gt;&lt;SPAN style="font-size: 11px; font-family: Monaco, 'Lucida Console', monospace; color: #339933; background-position: initial;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Monaco, 'Lucida Console', monospace; font-size: 11px; background-color: #f1f1f1;"&gt; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-size: 11px; font-weight: bold; font-family: Monaco, 'Lucida Console', monospace; color: #000066; background-position: initial;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 11px; font-family: Monaco, 'Lucida Console', monospace; color: #009900; background-position: initial;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Monaco, 'Lucida Console', monospace; font-size: 11px; background-color: #f1f1f1;"&gt;gr.&lt;/SPAN&gt;&lt;SPAN style="font-size: 11px; font-family: Monaco, 'Lucida Console', monospace; color: #660066; background-position: initial;"&gt;hasNext&lt;/SPAN&gt;&lt;SPAN style="font-size: 11px; font-family: Monaco, 'Lucida Console', monospace; color: #009900; background-position: initial;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-size: 11px; font-family: Monaco, 'Lucida Console', monospace; color: #009900; background-position: initial;"&gt;)&lt;/SPAN&gt;&lt;SPAN style="font-size: 11px; font-family: Monaco, 'Lucida Console', monospace; color: #009900; background-position: initial;"&gt;)&lt;/SPAN&gt;&lt;SPAN style="font-size: 11px; font-family: Monaco, 'Lucida Console', monospace; color: #009900; background-position: initial;"&gt;{&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Monaco, 'Lucida Console', monospace; font-size: 11px; background-color: #f1f1f1;"&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; template.&lt;/SPAN&gt;&lt;SPAN style="font-size: 11px; font-family: Monaco, 'Lucida Console', monospace; color: #000066; background-position: initial;"&gt;print&lt;/SPAN&gt;&lt;SPAN style="font-size: 11px; font-family: Monaco, 'Lucida Console', monospace; color: #009900; background-position: initial;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-size: 11px; font-family: Monaco, 'Lucida Console', monospace; color: #3366cc; background-position: initial;"&gt;'Attachments: &lt;SPAN style="font-weight: bold; color: #000099; background-position: initial;"&gt;\n&lt;/SPAN&gt;'&lt;/SPAN&gt;&lt;SPAN style="font-size: 11px; font-family: Monaco, 'Lucida Console', monospace; color: #009900; background-position: initial;"&gt;)&lt;/SPAN&gt;&lt;SPAN style="font-size: 11px; font-family: Monaco, 'Lucida Console', monospace; color: #339933; background-position: initial;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Monaco, 'Lucida Console', monospace; font-size: 11px; background-color: #f1f1f1;"&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-size: 11px; font-weight: bold; font-family: Monaco, 'Lucida Console', monospace; color: #000066; background-position: initial;"&gt;while&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Monaco, 'Lucida Console', monospace; font-size: 11px; background-color: #f1f1f1;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 11px; font-family: Monaco, 'Lucida Console', monospace; color: #009900; background-position: initial;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Monaco, 'Lucida Console', monospace; font-size: 11px; background-color: #f1f1f1;"&gt;gr.&lt;/SPAN&gt;&lt;SPAN style="font-size: 11px; font-family: Monaco, 'Lucida Console', monospace; color: #660066; background-position: initial;"&gt;next&lt;/SPAN&gt;&lt;SPAN style="font-size: 11px; font-family: Monaco, 'Lucida Console', monospace; color: #009900; background-position: initial;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-size: 11px; font-family: Monaco, 'Lucida Console', monospace; color: #009900; background-position: initial;"&gt;)&lt;/SPAN&gt;&lt;SPAN style="font-size: 11px; font-family: Monaco, 'Lucida Console', monospace; color: #009900; background-position: initial;"&gt;)&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Monaco, 'Lucida Console', monospace; font-size: 11px; background-color: #f1f1f1;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 11px; font-family: Monaco, 'Lucida Console', monospace; color: #009900; background-position: initial;"&gt;{&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Monaco, 'Lucida Console', monospace; font-size: 11px; background-color: #f1f1f1;"&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-size: 11px; font-weight: bold; font-family: Monaco, 'Lucida Console', monospace; color: #003366; background-position: initial;"&gt;var&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Monaco, 'Lucida Console', monospace; font-size: 11px; background-color: #f1f1f1;"&gt; attachLink &lt;/SPAN&gt;&lt;SPAN style="font-size: 11px; font-family: Monaco, 'Lucida Console', monospace; color: #339933; background-position: initial;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Monaco, 'Lucida Console', monospace; font-size: 11px; background-color: #f1f1f1;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 11px; font-family: Monaco, 'Lucida Console', monospace; color: #3366cc; background-position: initial;"&gt;'&amp;lt;a href="'&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Monaco, 'Lucida Console', monospace; font-size: 11px; background-color: #f1f1f1;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 11px; font-family: Monaco, 'Lucida Console', monospace; color: #339933; background-position: initial;"&gt;+&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Monaco, 'Lucida Console', monospace; font-size: 11px; background-color: #f1f1f1;"&gt; gs.&lt;/SPAN&gt;&lt;SPAN style="font-size: 11px; font-family: Monaco, 'Lucida Console', monospace; color: #660066; background-position: initial;"&gt;getProperty&lt;/SPAN&gt;&lt;SPAN style="font-size: 11px; font-family: Monaco, 'Lucida Console', monospace; color: #009900; background-position: initial;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-size: 11px; font-family: Monaco, 'Lucida Console', monospace; color: #3366cc; background-position: initial;"&gt;"glide.servlet.uri"&lt;/SPAN&gt;&lt;SPAN style="font-size: 11px; font-family: Monaco, 'Lucida Console', monospace; color: #009900; background-position: initial;"&gt;)&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Monaco, 'Lucida Console', monospace; font-size: 11px; background-color: #f1f1f1;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 11px; font-family: Monaco, 'Lucida Console', monospace; color: #339933; background-position: initial;"&gt;+&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Monaco, 'Lucida Console', monospace; font-size: 11px; background-color: #f1f1f1;"&gt; gs.&lt;/SPAN&gt;&lt;SPAN style="font-size: 11px; font-family: Monaco, 'Lucida Console', monospace; color: #660066; background-position: initial;"&gt;generateURL&lt;/SPAN&gt;&lt;SPAN style="font-size: 11px; font-family: Monaco, 'Lucida Console', monospace; color: #009900; background-position: initial;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Monaco, 'Lucida Console', monospace; font-size: 11px; background-color: #f1f1f1;"&gt;gr.&lt;/SPAN&gt;&lt;SPAN style="font-size: 11px; font-family: Monaco, 'Lucida Console', monospace; color: #660066; background-position: initial;"&gt;getTableName&lt;/SPAN&gt;&lt;SPAN style="font-size: 11px; font-family: Monaco, 'Lucida Console', monospace; color: #009900; background-position: initial;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-size: 11px; font-family: Monaco, 'Lucida Console', monospace; color: #009900; background-position: initial;"&gt;)&lt;/SPAN&gt;&lt;SPAN style="font-size: 11px; font-family: Monaco, 'Lucida Console', monospace; color: #339933; background-position: initial;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Monaco, 'Lucida Console', monospace; font-size: 11px; background-color: #f1f1f1;"&gt;gr.&lt;/SPAN&gt;&lt;SPAN style="font-size: 11px; font-family: Monaco, 'Lucida Console', monospace; color: #660066; background-position: initial;"&gt;sys_id&lt;/SPAN&gt;&lt;SPAN style="font-size: 11px; font-family: Monaco, 'Lucida Console', monospace; color: #009900; background-position: initial;"&gt;)&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Monaco, 'Lucida Console', monospace; font-size: 11px; background-color: #f1f1f1;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 11px; font-family: Monaco, 'Lucida Console', monospace; color: #339933; background-position: initial;"&gt;+&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Monaco, 'Lucida Console', monospace; font-size: 11px; background-color: #f1f1f1;"&gt; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-size: 11px; font-family: Monaco, 'Lucida Console', monospace; color: #3366cc; background-position: initial;"&gt;'"&amp;gt;'&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Monaco, 'Lucida Console', monospace; font-size: 11px; background-color: #f1f1f1;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 11px; font-family: Monaco, 'Lucida Console', monospace; color: #339933; background-position: initial;"&gt;+&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Monaco, 'Lucida Console', monospace; font-size: 11px; background-color: #f1f1f1;"&gt; gr.&lt;/SPAN&gt;&lt;SPAN style="font-size: 11px; font-family: Monaco, 'Lucida Console', monospace; color: #660066; background-position: initial;"&gt;file_name&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Monaco, 'Lucida Console', monospace; font-size: 11px; background-color: #f1f1f1;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 11px; font-family: Monaco, 'Lucida Console', monospace; color: #339933; background-position: initial;"&gt;+&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Monaco, 'Lucida Console', monospace; font-size: 11px; background-color: #f1f1f1;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 11px; font-family: Monaco, 'Lucida Console', monospace; color: #3366cc; background-position: initial;"&gt;'&amp;lt;/a&amp;gt;'&lt;/SPAN&gt;&lt;SPAN style="font-size: 11px; font-family: Monaco, 'Lucida Console', monospace; color: #339933; background-position: initial;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Monaco, 'Lucida Console', monospace; font-size: 11px; background-color: #f1f1f1;"&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; template.&lt;/SPAN&gt;&lt;SPAN style="font-size: 11px; font-family: Monaco, 'Lucida Console', monospace; color: #000066; background-position: initial;"&gt;print&lt;/SPAN&gt;&lt;SPAN style="font-size: 11px; font-family: Monaco, 'Lucida Console', monospace; color: #009900; background-position: initial;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Monaco, 'Lucida Console', monospace; font-size: 11px; background-color: #f1f1f1;"&gt;attachLink &lt;/SPAN&gt;&lt;SPAN style="font-size: 11px; font-family: Monaco, 'Lucida Console', monospace; color: #339933; background-position: initial;"&gt;+&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Monaco, 'Lucida Console', monospace; font-size: 11px; background-color: #f1f1f1;"&gt; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-size: 11px; font-family: Monaco, 'Lucida Console', monospace; color: #3366cc; background-position: initial;"&gt;'&lt;SPAN style="font-weight: bold; color: #000099; background-position: initial;"&gt;\n&lt;/SPAN&gt;'&lt;/SPAN&gt;&lt;SPAN style="font-size: 11px; font-family: Monaco, 'Lucida Console', monospace; color: #009900; background-position: initial;"&gt;)&lt;/SPAN&gt;&lt;SPAN style="font-size: 11px; font-family: Monaco, 'Lucida Console', monospace; color: #339933; background-position: initial;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Monaco, 'Lucida Console', monospace; font-size: 11px; background-color: #f1f1f1;"&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-size: 11px; font-family: Monaco, 'Lucida Console', monospace; color: #009900; background-position: initial;"&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Monaco, 'Lucida Console', monospace; font-size: 11px; background-color: #f1f1f1;"&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; template.&lt;/SPAN&gt;&lt;SPAN style="font-size: 11px; font-family: Monaco, 'Lucida Console', monospace; color: #000066; background-position: initial;"&gt;print&lt;/SPAN&gt;&lt;SPAN style="font-size: 11px; font-family: Monaco, 'Lucida Console', monospace; color: #009900; background-position: initial;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-size: 11px; font-family: Monaco, 'Lucida Console', monospace; color: #3366cc; background-position: initial;"&gt;'&amp;lt;hr/&amp;gt;'&lt;/SPAN&gt;&lt;SPAN style="font-size: 11px; font-family: Monaco, 'Lucida Console', monospace; color: #009900; background-position: initial;"&gt;)&lt;/SPAN&gt;&lt;SPAN style="font-size: 11px; font-family: Monaco, 'Lucida Console', monospace; color: #339933; background-position: initial;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Monaco, 'Lucida Console', monospace; font-size: 11px; background-color: #f1f1f1;"&gt; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-size: 11px; font-family: Monaco, 'Lucida Console', monospace; color: #009900; background-position: initial;"&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;SPAN style="font-size: 11px; font-family: Monaco, 'Lucida Console', monospace; color: #009900; background-position: initial;"&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;SPAN style="font-size: 11px; font-family: Monaco, 'Lucida Console', monospace; color: #339933; background-position: initial;"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Monaco, 'Lucida Console', monospace; font-size: 11px; background-color: #f1f1f1;"&gt;mail_script&lt;/SPAN&gt;&lt;SPAN style="font-size: 11px; font-family: Monaco, 'Lucida Console', monospace; color: #339933; background-position: initial;"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;my requirement is pdf document will show the document list attached with that particular incident &lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 12 May 2016 16:00:31 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/pdf-generation-in-geneva/m-p/1751088#M408014</guid>
      <dc:creator>bhavu81</dc:creator>
      <dc:date>2016-05-12T16:00:31Z</dc:date>
    </item>
    <item>
      <title>Re: PDF Generation in Geneva</title>
      <link>https://www.servicenow.com/community/developer-forum/pdf-generation-in-geneva/m-p/1751089#M408015</link>
      <description>&lt;P&gt;I dont think you can use &amp;lt;mail_script&amp;gt; in document template.&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;However you can look into developing some script in script include which could return the list. Have a look at below code in parseBody method.&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;parsedBody = parsedBody.replace(/\$\{date\}/gi, date);&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;parsedBody = parsedBody.replace(/\$\{letterid\}/gi, this.letterid);&lt;/P&gt;&lt;BR /&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;you could build a variable similar to this i.e ${attachlinks} and script in parseBody to return the values you want.&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Syed.&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 12 May 2016 23:22:34 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/pdf-generation-in-geneva/m-p/1751089#M408015</guid>
      <dc:creator>syed_faheem</dc:creator>
      <dc:date>2016-05-12T23:22:34Z</dc:date>
    </item>
    <item>
      <title>Re: PDF Generation in Geneva</title>
      <link>https://www.servicenow.com/community/developer-forum/pdf-generation-in-geneva/m-p/1751090#M408016</link>
      <description>&lt;P&gt;Hi Ken,&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;I dont think it would be supported as Walter Brame's &amp;nbsp; code has been modified and in Geneva and it does not support full functionality yet. As per my knowledge product development would fill up these gaps in next 2 releases.&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Syed.&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 12 May 2016 23:36:27 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/pdf-generation-in-geneva/m-p/1751090#M408016</guid>
      <dc:creator>syed_faheem</dc:creator>
      <dc:date>2016-05-12T23:36:27Z</dc:date>
    </item>
  </channel>
</rss>

