- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-16-2023 11:24 AM
Hi guys,
I have a form of a table record in a WORKSPACE, on which I need a button to export the record to PDF format and download it.
I know we have url that helps to export the record to PDF (url is https://<instance_name>.service-now.com/<table_name>.do?PDF&sys_id=<Sys ID of the record>&sysparm_view=<Form View>),
but how do I hit that link from the button ? or any other way using UXF Declarative Action and Event Mapping and Event Handler ?
I tried with a UI Action with action.setRedirectURL(url) that never worked for the workspace).
Any help is appreciated. Thanks!
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-16-2023 01:26 PM
You could do this with a button in UIB that uses the link to destination event to open the pdf view in a new browser tab. Check out this post on how to redirect to a non-workspace link: https://www.servicenow.com/community/developer-forum/how-to-pass-a-parameter-to-an-link-to-destinati...
You should also be able to do this with a declarative action that fires an event and uses the same event handler, but the UIB button component seems simpler.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-16-2023 01:26 PM
You could do this with a button in UIB that uses the link to destination event to open the pdf view in a new browser tab. Check out this post on how to redirect to a non-workspace link: https://www.servicenow.com/community/developer-forum/how-to-pass-a-parameter-to-an-link-to-destinati...
You should also be able to do this with a declarative action that fires an event and uses the same event handler, but the UIB button component seems simpler.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-16-2023 01:30 PM
But I need the button on the Record Page Component, so shouldn't we take the route of UI Actions/UX Form Actions ?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-16-2023 01:41 PM
If you want it in the action bar it'll need to be a declarative action, otherwise you can just put it somewhere on the page from UIB. Just depends on where you want it.