How to configure ui action popup
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-06-2023 12:28 AM
Hi All,
When i click on save button on sctask, i wish have below popup, how to configure this?
2 REPLIES 2
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-06-2023 12:57 AM
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-06-2023 01:40 AM - edited 06-06-2023 01:41 AM
You need to create UI action with "Client" checked.
In "Onclick" field you can call function from your script field. For example: confirmSomeImportantAction();
In script you can use GlideModal with ootb modal confirm page: glide_modal_confirm
function confirmSomeImportantAction(){
var dialog = new GlideModal('glide_modal_confirm', true, 400);
dialog.setTitle("Are you really sure?");
dialog.setPreference("body", "Sir, please confirm you want to do this serious thing");
dialog.setPreference("buttonLabelCancel", getMessage("Cancel"));
dialog.setPreference("buttonLabelComplete", getMessage("Sure"));
dialog.setPreference('onPromptCancel', cancelAction.bind(this));
dialog.setPreference('onPromptComplete', forceAction.bind(this));
dialog.render();
}
function forceAction() {
gsftSubmit(null, g_form.getFormElement(), "replace_withaction_name_of_ths_ui_action");
}
function cancelAction() {
g_form.addInfoMessage('You cancelled action');
}
if (typeof window == 'undefined') {
//Write server code here
}