The CreatorCon Call for Content is officially open! Get started here.

Form Incident - Export PDF by Navigating by URL

claudiofrazao
Kilo Contributor

I need to export form incident data to pdf through navigating url.

I am using ..../nav_to.do?PDF&uri=incident.do?sys_id=83d39b3918172050e45, but I'm not having successful.

Please, anybody can help me ?

Thanks for attention

Claudio Frazão

3 REPLIES 3

nthumma
Giga Guru

Create UI Action and write below code


function createPDF() {  


  var sysparm_table = g_form.getTableName();


  var sysparm_view = 'Pdfview';// this should be your view name.


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


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


  window.open(url);  


}  


Great! I'm got it with your tip!


Thank so much,, srnewbie. !


Now, I have just one small doubt. It's possible to change sysparm_sys_id to incident number. How I have structure the UI Action code ?


Like:


....service-now.com/incident.do?PDF&sysparm_query=number=AT0070000


As per my knowledge it has to be sys_id.