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.

Auto download Inc Number as pdf when click on button

Rajkumar Bommal
Tera Contributor

RajkumarBommal_0-1713876969888.png

hi i have created a button called PDF 
when i click on the button i need to download only INC number as pdf

 

 

1 REPLY 1

Appanna M
Tera Guru

Hello @Rajkumar Bommal ,

 

Try with the below code, it should works. I tried in my PDI.

 

 

 

    function getIncidentPDF() {
        alert("Hi:" + g_form.getUniqueValue());
        //gsftSubmit(null, g_form.getFormElement(), 'download_pdf');
        top.window.open('https://dev*****.service-now.com/incident.do?PDF&sys_id=' + g_form.getUniqueValue(), '_blank');// replace ***** with your instance 
    }

    

 

 

Appanna_3-1713893859805.png

 

 

Appanna_1-1713893619936.png

 

 

Please Mark My Answer as Helpful and Accept as Solution, if you find this article helpful or resolves your issue.