Workspace yes and no popup
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 hours ago
Hi,
function onClick() {
var comments = g_form.getValue("comments");
if (!comments) {
alert('The "Additional comments" field must be filled in before the transtitioning to Canceled');
return false;
}
g_modal.confirm('Confirmation', 'Are you sure you want to cancel this incident?', {
cancelTitle: 'No', // Custom label for the 'No' button
confirmTitle: 'Yes' // Custom label for the 'Yes' button
}).then(function() {
// Executes if user clicks Yes
g_form.setValue('incident_state', '8'); // Cancelled
g_form.setValue('state', '8');
g_form.submitAction("cancel_incident"); // Trigger server-side UI Action
}, function() {
// Executes if user clicks No or closes the dialog
});I have written the workspace client script for yes and no button while clicking upon cancel ui action button.
The popup up is coming with yes and no but clicking on yes or no it is not working.
Anupam
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
32m ago
Hi @Sandeep8987
Check this code
function onClick() {
var comments = g_form.getValue("comments");
if (!comments) {
alert('The "Additional comments" field must be filled in before transitioning to Canceled');
return false;
}
g_modal.confirm(
'Confirmation',
'Are you sure you want to cancel this incident?',
function(confirmed) {
if (confirmed) {
g_form.setValue('state', '8');
g_form.save();
}
}, {
"cancelTitle": "No",
"confirmTitle": "Yes"
});
return false;
}
