Custom view creation

Cynthia19
Tera Contributor

Hello

 

I need to create a new view that only contains certain fields from the change request and a UI action button to call the export to pdf script. So that when I select the UI action button, I am able to download a generated a PDF that contains only the fields in the custom view. 

 

Has anyone done this before? if so, may I get some guidance?

 

Thank you 

 

Please not, field I need removed are highlighted in red (see attached)

1 REPLY 1

SanjivMeher
Kilo Patron
Kilo Patron

Can you create a UI action with client box checked? And add below script to the UI action and call this function in onClick.

 

function printPDF()

{

var sysparm_table = g_form.getTableName();  

  var sysparm_sys_id = g_form.getUniqueValue().toString();

  var sysparm_view= "<View Name>" ;

  var url = sysparm_table + '.do?PDF&sys_id=' + sysparm_sys_id + '&sysparm_view=' + sysparm_view;

  window.open(url);  

}

Please mark this response as correct or helpful if it assisted you with your question.