UI Action -Print to PDF

pramn
Tera Guru

Morning Team, 

 

W have a requirement to Create a UI action to PRINT To PDF, I have done something but not getting expected result .

Could you Please help me with it .

pramn_0-1696571492832.png

script is 

 function gen_pdf() {
 var rm = new sn_ws.RESTMessageV2();
rm.setHttpMethod('GET');
var url = gs.getProperty("glide.servlet.uri") + current.getTableName() + '.do?PDF&sys_id=' + current.sys_id;
rm.setEndpoint(url);
rm.setBasicAuth(gs.getProperty('glide.user.userid'), gs.getProperty('glide.user.password'));
rm.saveResponseBodyAsAttachment(current.getTableName(), current.sys_id, current.number + ".pdf");
var response = rm.execute();
action.setRedirectURL(current.getTableName()+'.do?sys_id='+current.sys_id);
 }
 
Please help me to fix this .
Thanks in advance .
10 REPLIES 10

Hi @Amit Gujarathi ,

 

Is there a way to give a title to the PDF?