How to download the request as pdf from portal and not from native

suuriyas
Tera Contributor

HI Community,

 

I have a requirement where i need to create a button in serviceportal.

Purpose of this button is once the end user submit the request and when they click the button it download it as pdf of the request 

 

How can we do it.

Is there any other alternative way ? instead of creating a widget for it.

Main requirement is end user wanted to download the ritm as pdf from portal and not from native

6 REPLIES 6

Dr Atul G- LNG
Tera Patron
Tera Patron

Hi @suuriyas 

May I know what the end user will do after downloading the PDF? Out of the box, this isn’t available — you would need to build a custom solution, which could become technical debt for you.”

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************

Muhammad Salar
Giga Sage

Hi @suuriyas 
You need to copy existing widget SC Order Status, make changes
remove the OOB widget and add this copied widget on order_status portal page

This is not recommended but if you want a solution then follow this:

Clone SC Order Status Widget
Changes in SC Order Status widget:

HTML:

MuhammadSalar_0-1764708027997.png

<div class="download-btn-container">
          <button class="btn btn-primary btn-sm" ng-click="downloadRITM()">
          Download RITM
          </button>
       </div>


CSS:
.download-btn-container {
position: absolute;
top: 0;
right: 0;
margin-top: 10px;
margin-right: 20px;
}

Client controller:

$scope.downloadRITM = function() {
        var ritmSysIds = c.data.request.requestItems;
        for (var i=0; i<ritmSysIds.length; i++){
			var url = '/sc_req_item.do?PDF&sys_id=' + ritmSysIds[i].sys_id;
		}

        $window.open(url, '_blank');
    }


It will appear like this on order_status page

MuhammadSalar_1-1764708246515.png


After clicking:

MuhammadSalar_2-1764708273886.png



MuhammadSalar_3-1764708295226.png

 

 



 

HI @Muhammad Salar ,

 

Thanks for the response

This looks promising 

 

But will it provide all details? like variables, fields names etc?

correction mine is a record producer once the request is submitted it will create a record in hr benefit case table.

Shruti
Giga Sage
Giga Sage

Hi @suuriyas 

Once the request is submitted, you can send the PDF as an email attachment rather than modifying the portal widgets.