Cancel request from Service Portal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-01-2020 10:05 PM
Hi All,
In OOTB Service Portal page, I am able to submit a request as an end-user but there is no cancel option to cancel a request.
How can I activate Cancel option on Service Portal page OOTB?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-01-2020 10:57 PM
Hi,
First you have to clone OOTB widget to make changes.
Then write this code to add new Cancel Button,
HTML section:
(It is a new widget that has to be placed on the proper page in the Page editor)
// write this code in under <div> tag where submit button code already present.
<button ng-if="c.data.showCancel" type="button" class="btn btn-primary btn-block" ng-click="c.uiAction('cancel')">Cancel</button>
Server side script:
(function() {
data.showCancel = false;
var canceled = IncidentState.CANCELED;
if (action == 'cancel') {
//Cancel
gr.setValue('incident_state', canceled);
gr.setValue('state', canceled);
gr.update();
}
For More understanding refer below thread which has similar issue as yours. Check this out.
Please mark correct and helpful if you find my response worthy based on the impact.
Regards,
Vishakha