Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

ui action

abhi159
Kilo Sage

create a ui action to download the current incident form with the values filled in incident

 

1 ACCEPTED SOLUTION

Hi @abhi159 ,

Try below script in ui action table incident, Client-true,Form Button-True, Onclick- exportPDF(),Show Update Insert-True

AnandKumarP_0-1699252310133.png

 

AnandKumarP_1-1699252671290.png

function exportPDF() {
 var sysparm_table = g_form.getTableName();
 var sysparm_sys_id = g_form.getUniqueValue().toString();
 var instanceName='https://yourdevinstanceurl.service-now.com/';//change this to your instance url
 var url = instanceName+sysparm_table + '.do?PDF&sys_id=' + sysparm_sys_id;
 g_navigation.openPopup(url);
}

 

AnandKumarP_2-1699252691866.png

 

AnandKumarP_3-1699252717839.png


Please mark it as helpful and solution proposed if it serves your purpose.

Thanks,

Anand




 

View solution in original post

6 REPLIES 6

excel of incident record

@abhi159 

what script did you start with and where are you stuck?

Is it client side UI action or server side?

 

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader