UI Action to export PDF and only visible to Incident_ managers
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-01-2024 06:46 PM
Hello all,
Within the incident form, I have a new view created that should only be visible to the incident managers, called Major Incidents when I open that view, I need to add a button to the view only and only visible to incident_manager. How do I configure this UI Action button to work to export the incident as a PDF.
Please keep in mind that these users can eft click and then select export to PDF to export, but they just want to see an export button where they can just click and it does same thing as the left click
How can I achieve this please, can I get help
Thank you all
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-01-2024 09:51 PM
Hi @char01 ,
If you have the UI action already available in the form context menu (left click), and you want the same to be available as a button then you check make the 'Form Button' checkbox as true.
If you want this to be available in certain view then add this in the conditions - RP.getParameterValue('sysparm_view') == <viewName>
For showing them only to users with incident_manager role include below in the condition :
&& gs.hasRole("incident_manager")
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-02-2024 06:29 AM
Thank you for the response but I do not have a UI action on the context menu. So after creating it, what next?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-02-2024 10:53 PM
After creating the UI action, add a logic similar to what's mentioned in this thread to export as pdf - https://www.servicenow.com/community/developer-forum/export-a-pdf-of-resolved-incident-automatically... and specify the conditions per the previous response.