UI Action to export PDF and only visible to Incident_ managers

char01
Tera Contributor

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

3 REPLIES 3

Sonam_Tiwari
Kilo Sage

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")

 

 

Consider indicating the response as helpful and marking it as correct if it meets your needs.

Thank you for the response but I do not have a UI action on the context menu. So after creating it, what next?

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.

 

 

 

 

Consider indicating the response as helpful and marking it as correct if it meets your needs.