From e2589a3a546bd22333e180ff1b01a242864ab172 Mon Sep 17 00:00:00 2001 From: Riya Misra <146907130+riya-misra-1@users.noreply.github.com> Date: Tue, 31 Oct 2023 16:30:25 +0530 Subject: [PATCH 1/2] Create script.js --- UI Actions/Cancel Incident/script.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 UI Actions/Cancel Incident/script.js diff --git a/UI Actions/Cancel Incident/script.js b/UI Actions/Cancel Incident/script.js new file mode 100644 index 0000000000..fd7a2f0c96 --- /dev/null +++ b/UI Actions/Cancel Incident/script.js @@ -0,0 +1,17 @@ +function cancelIncident(){ + var gm = new GlideModal("glide_ask_standard", false, 600); // glide modal to get the confirmation + gm.setPreference("title", "Are you sure you wanna cancel incident!!!"); + gm.setPreference("onPromptComplete", function() { + gsftSubmit(null,g_form.getFormElement(),'cancel_incident');}); //calling same ui action + gm.render(); + +} + +if(typeof window == 'undefined'){ + serverCancel(); +} + +function serverCancel(){ + current.state = '8'; //setting the state to canceled + current.update(); +} From fea3441a11625239f31c8f97d44ce540fc5d780d Mon Sep 17 00:00:00 2001 From: Riya Misra <146907130+riya-misra-1@users.noreply.github.com> Date: Tue, 31 Oct 2023 16:32:52 +0530 Subject: [PATCH 2/2] Create readme.md --- UI Actions/Cancel Incident/readme.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 UI Actions/Cancel Incident/readme.md diff --git a/UI Actions/Cancel Incident/readme.md b/UI Actions/Cancel Incident/readme.md new file mode 100644 index 0000000000..62710388e3 --- /dev/null +++ b/UI Actions/Cancel Incident/readme.md @@ -0,0 +1 @@ +This is a ui action run on incident table which is client callable, run on condition current.state == '1' which means when state is new.It cancel the incident through the form.