- Post History
- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
02-18-2024 12:12 AM - edited 02-18-2024 12:12 AM
Generate PDF from UI action
Sample code :
You can use the below code in your UI action to generate a PDF.
function generatePDF(){
var sysparm_table = g_form.getTableName();
var sysparm_sys_id = g_form.getUniqueValue().toString();
var link='https://dev113064.service-now.com/'; // Replace with sys_parm to get the instace name
var url = link+sysparm_table + '.do?PDF&sys_id=' + sysparm_sys_id;
g_navigation.openPopup(url);
}
Note:
1. Recommend to use sys_property to build the url.
2. You can use page_view in URL for a specfic view of fields using sysparm_view.
<<< Top Articles >>>
- ServiceNow Integration with Splunk
- LDAP Integration with ServiceNow
- ServiceNow Integration with Veeam
- Handling ServiceNow flow errors with a flow
- Show parent child incident relationships - display in field message
- ServiceNow SSO Logout Error (redirects to logout page) – Reason, Fixes and Cause.
- Multi Row Variable set ServiceNow MRVS - Creating - Scripting - Example - Limits
- ServiceNow Integration with MAC vendor - Get Mac vendor for the given MAC Address.
- How to find Log4j vulnerable severs in ServiceNow Using CMDB Query Builder (SecOps)
- How to Cancel a Long-Running Transaction ServiceNow
- Hidden Features for System Administrators
- Servicenow RPA - Understanding Attended / Unattended / Skilled Automation Bots
- How to Perform Servicenow vCenter Discovery | Discovering VMware using vCenter Discovery
- Set Discovery Schedule name to CMDB Record (via Discovery)
- Step by Step - How to discover Linux Servers in ServiceNow
MF Sohail Khilji | Servicenow Developer / Consultant.
- 4,758 Views
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Hi @Sohail Khilji ,
I attempted using my PDI URL from the URL section as demonstrated, but haven't had any success so far. Could you help me in elaborating your recommendation "Recommend to use sys_property to build the url" please?
Thank you!
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Hi @Sohail Khilji ,it worked perfectly. But can we make it attach to the current record? Thank you.
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
I want CDF format is it possible?