cancel button on change task
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-29-2024 12:46 AM
Hello
I want to create cancel button on change task which will cancel the change task .
It should make worknote field mandatory and add pop up whenever user tries to cancel the change task
6 REPLIES 6
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-29-2024 02:19 AM - edited 04-29-2024 02:20 AM
Hi @harry24
create a client callable ui action
onclick call the function name:openConfirmationDialog()
use the below code:
function openConfirmationDialog() {
var gm = new GlideModal("glide_confirm_standard", true, 600);
gm.setTitle("Test title");
gm.setPreference("title", "Test body text");
gm.setPreference("warning", "false");
gm.setPreference("onPromptComplete", function() {
g_form.setMandatory('work_notes', true);
});
gm.setPreference("onPromptCancel", function() {
alert("You clicked on 'Cancel'");
});
gm.render();
}
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-29-2024 04:42 AM
Hi @harry24
Why you need a button, we have OOTB cancel value in state and use that to do your work.
*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************