Modal window for Approval rejected

Amrit Pal
Giga Contributor

I want to pop-up a modal window when a approver is rejecting a approval to provide the rejection comments .

For that I am editing out of the box Approvals widget.

But I am unable to create the pop up modal window. Anyone can help me in editing the Approvals widget to acquire my output.The comments will populate in comments  

4 REPLIES 4

Rohit Kaintura
Mega Guru

Refer these examples of modal window.

These will be helpful.

 

https://developer.servicenow.com/app.do#!/api_doc?v=kingston&id=SPModal-API

 


Please mark my answer correct and helpful if my answer helped u. Thank you.

Amrit Pal
Giga Contributor

Has anyone edited the 'Approvals' widget, for such requirement?

 

Amrit Pal
Giga Contributor

Or is there any way for this requirement , where approver when rejecting has to comment why he/she is rejecting when approved via 'Approvals' widget.

Yeah, I added an Angular ng-tempalte that gets called by rejection action:

 

<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title">Reason for rejecting this request</h4>
</div>
<div class="panel-body wrapper-xl">
<form name="modalTemplateRejectComment" ng-submit="c.action('rejected')">
<div class="form-group">
<textarea required sp-autosize="true" ng-required="true" ng-model="data.rejectionComments" id="rejectionComments" placeholder="Comments required" class="form-control ng-pristine ng-valid ng-scope ng-empty ng-touched" aria-invalid="false" style="overflow: hidden; word-wrap: break-word; resize: horizontal;"></textarea>
</div>
<input class="btn btn-primary" type="submit" />
</form>
</div>
</div>