How to configure sweet alert in Servicenow
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-26-2022 02:25 AM
I need to use sweet alert in catalog client sprit . could any one share the whole process .
5 REPLIES 5
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-27-2022 03:06 AM
function onLoad() {
swal({
title: 'Please read the terms!',
text: 'You can request this catalog item only on weekends . Would you like to continue ? ',
type: 'info',
showCancelButton: true,
confirmButtonText: 'Yes, I understand the terms!'
}).then(function(result) {
alert(result);
if (!result.value)
top.location.href = '/vd';
});
}
Promises is not working in ServiceNow as it supports ES5 so how do i handle this ? sweet alert is populating in my portal but it is not waiting for user confirmation