
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-30-2016 03:38 PM
Hi - this topic has been hinted at here and there but I haven't found a solution as yet.
I have a custom view for our Incident form which is the "Customer PDF Export" view. It's basically a limited information view of the incident, and onLoad, it uses g_form.hideRelatedLists() to... hide the related lists. All works fine.
Problem is, when you them export that to PDF using the built-in context menu, the related lists show up in the PDF.
Does anyone know if there's a way to correct this behaviour, OR - failing that - some other way to customise the PDF output?
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-31-2016 07:54 AM
Hi Steve,
These are the steps you might want to try out in order
1. Create a new view say Print from Form Layout and ensure only the sections you want is there and save
2. Go to the Print view. Then right click again on the form and go to related lists. Remove the related lists for this view and save.
Then you would be able to access the print without related list say using a url
instance.service-now.com/nav_to.do?uri=/incident.do%3Fsys_id%3D282c3edc4f9256007e04c4b18110c7e9%26sysparm_view%3Dprint%26PDF
Replace the instance with your instance name, view with the view name your prefer and the sysid accordingly. %26 is the & equivalent.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-30-2016 03:47 PM
Hi Steve,
One of the ways to get a customized pdf is using a mid server. I have detailed in the idea blog below.
Customized Print Solution using MidServer
If it just hiding the related list , one suggestion i have for your scenario is to create a view and then use that while using the PDF webservice using ?PDF. If that doesnt still work, we can may be create a custom public processor.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-30-2016 03:51 PM
Thanks for the response - can you elaborate on "PDF webservice using ?PDF"? Or possibly provide a link to some doco?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-30-2016 06:34 PM
Hi Steve,
Below is the link for documentation
http://wiki.servicenow.com/index.php?title=PDF_Web_Service#gsc.tab=0
For e.g say you want to show an incident table in a different view with no related list in it and download it as PDF format
ess can be replaced with view name you created.
To create this above url, you can test it initially by getting the sys id of the record but if you want to give that provision to user you can create a UI action and take the current.sys_id to make the URL for PDF generation.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-30-2016 07:01 PM
That's very cool - didn't know you could do that.
It gives the same result though as manually using the "Export PDF" option - i.e. it still shows the related lists.