- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-15-2024 12:13 AM
Hello Team
I'm trying to write a UI action button for this scenario.
The button will be displayed in the incident form, when the user clicks on that button then a confirmation pop-up should be shown to the User whether he wants to close the attached child incident or not?.. If he said Yes then the child incident will be closed. I created the UI action button and wrote the code. Then I went to test it and the button didn't do anything when I clicked. I think the code is right. Or if you have another way to write this. Please suggest! Thank You for your help
function demoClientScript() {
var answer = confirm("Are you sure to close the attached Child Incident");
if (answer == true)
{
gsftSubmit(null, g_form.getFormElement(), 'sys_demoaction');
}
}
var gr = new GlideRecord('incident');
gr.addQuery('parent_incident', current.sys_id);
gr.query();
while (gr.next()) {
gr.state = '7';
gr.update();
}
action.setRedirectURL(current);
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-15-2024 05:22 AM
Hello @SnowDevOps plz use the below code its working.
Please let me know if this solution works for you, and mark my answer as correct and helpful if it does."
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-15-2024 05:22 AM
Hello @SnowDevOps plz use the below code its working.
Please let me know if this solution works for you, and mark my answer as correct and helpful if it does."