How to modify the fields that are exported into a PDF file from the Service Portal Form widget. Is it possible to select different fields to be exported in a PDF? 


By default, the fields exported into a PDF file are the same displayed in the Form widget which are the fields displayed in the Service Portal view (sp). However, this behavior can be change after a customization and different fields can be displayed in the Form and be exported. Below the steps to follow:

  1. Create a new view and form for the table you are using, for example incident table
  2. Clone the Form widget 
  3. Edit the Form widget,  go to Line 40 and 4 in the HTML Template section. You will see:

    <li><a target="_new" href="/{{data.f.table}}.do?PDF&sys_id={{data.sys_id}}&sysparm_view={{data.f.view}}">${Export to PDF}</a></li>
    <li><a target="_new" href="/{{data.f.table}}.do?PDF&landscape=true&sys_id={{data.sys_id}}&sysparm_view={{data.f.view}}">${Export to PDF (landscape)}</a></li>

    4. Change the value of the parameter "sysparm_view parameter" to the view you want to use for the PDF file, for example pdfview:

    <li><a target="_new" href="/{{data.f.table}}.do?PDF&sys_id={{data.sys_id}}&sysparm_view=pdfview">${Export to PDF}</a></li>
    <li><a target="_new" href="/{{data.f.table}}.do?PDF&landscape=true&sys_id={{data.sys_id}}&sysparm_view=pdfview">${Export to PDF (landscape)}</a></li> 

           5. Save 




Article Information

Last Updated:2019-11-11 10:38:14