From b802651c8d8eae91215794ea0cce5ab7b18ce874 Mon Sep 17 00:00:00 2001 From: chaytarak <62869669+chaytarak@users.noreply.github.com> Date: Tue, 28 Oct 2025 20:44:04 +0530 Subject: [PATCH 1/5] Create ReadMe.md --- .../Abort action when description is empty/ReadMe.md | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 Client-Side Components/Client Scripts/Abort action when description is empty/ReadMe.md diff --git a/Client-Side Components/Client Scripts/Abort action when description is empty/ReadMe.md b/Client-Side Components/Client Scripts/Abort action when description is empty/ReadMe.md new file mode 100644 index 0000000000..c7acffd1e0 --- /dev/null +++ b/Client-Side Components/Client Scripts/Abort action when description is empty/ReadMe.md @@ -0,0 +1,2 @@ +When an Incident record is being closed, the system should validate that the Description field is not empty. +If the Description field is blank, the record submission (update) should be aborted, and the user should be prompted to provide a description before closing the incident. From ebce0797f4a5cb45c053cb544f69f9bf00a4a00e Mon Sep 17 00:00:00 2001 From: chaytarak <62869669+chaytarak@users.noreply.github.com> Date: Tue, 28 Oct 2025 20:44:48 +0530 Subject: [PATCH 2/5] Create Code.js --- .../Abort action when description is empty/Code.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 Client-Side Components/Client Scripts/Abort action when description is empty/Code.js diff --git a/Client-Side Components/Client Scripts/Abort action when description is empty/Code.js b/Client-Side Components/Client Scripts/Abort action when description is empty/Code.js new file mode 100644 index 0000000000..afdc44de2f --- /dev/null +++ b/Client-Side Components/Client Scripts/Abort action when description is empty/Code.js @@ -0,0 +1,12 @@ +function onSubmit() { + //Type appropriate comment here, and begin script below + var description = g_form.getValue('description'); + var status = g_form.getValue('status'); + + if ((!description) || (status == 'completed')) { + g_form.addErrorMessage('Please provide Description Value, Description Cannot be empty'); + + return false; + } + +} From 83820f2dce084f9c0002b01487b987d808ad928b Mon Sep 17 00:00:00 2001 From: chaytarak <62869669+chaytarak@users.noreply.github.com> Date: Tue, 28 Oct 2025 23:08:35 +0530 Subject: [PATCH 3/5] Update Code.js --- .../Abort action when description is empty/Code.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Client-Side Components/Client Scripts/Abort action when description is empty/Code.js b/Client-Side Components/Client Scripts/Abort action when description is empty/Code.js index afdc44de2f..377f289a1c 100644 --- a/Client-Side Components/Client Scripts/Abort action when description is empty/Code.js +++ b/Client-Side Components/Client Scripts/Abort action when description is empty/Code.js @@ -1,9 +1,9 @@ function onSubmit() { //Type appropriate comment here, and begin script below var description = g_form.getValue('description'); - var status = g_form.getValue('status'); + var status = g_form.getValue('state'); - if ((!description) || (status == 'completed')) { + if ((!description) && (state == 'completed')) { g_form.addErrorMessage('Please provide Description Value, Description Cannot be empty'); return false; From 86f2512655d0ebd913a3c07674eff43c102cb724 Mon Sep 17 00:00:00 2001 From: chaytarak <62869669+chaytarak@users.noreply.github.com> Date: Tue, 28 Oct 2025 23:09:08 +0530 Subject: [PATCH 4/5] Update Code.js --- .../Abort action when description is empty/Code.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Client-Side Components/Client Scripts/Abort action when description is empty/Code.js b/Client-Side Components/Client Scripts/Abort action when description is empty/Code.js index 377f289a1c..763e34d973 100644 --- a/Client-Side Components/Client Scripts/Abort action when description is empty/Code.js +++ b/Client-Side Components/Client Scripts/Abort action when description is empty/Code.js @@ -1,7 +1,7 @@ function onSubmit() { //Type appropriate comment here, and begin script below var description = g_form.getValue('description'); - var status = g_form.getValue('state'); + var state = g_form.getValue('state'); if ((!description) && (state == 'completed')) { g_form.addErrorMessage('Please provide Description Value, Description Cannot be empty'); From ec0a3bbeb9cdcfd0a622bea1d7e6d55fc747b086 Mon Sep 17 00:00:00 2001 From: chaytarak <62869669+chaytarak@users.noreply.github.com> Date: Tue, 28 Oct 2025 23:11:56 +0530 Subject: [PATCH 5/5] Update ReadMe.md --- .../Abort action when description is empty/ReadMe.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Client-Side Components/Client Scripts/Abort action when description is empty/ReadMe.md b/Client-Side Components/Client Scripts/Abort action when description is empty/ReadMe.md index c7acffd1e0..62906c16fe 100644 --- a/Client-Side Components/Client Scripts/Abort action when description is empty/ReadMe.md +++ b/Client-Side Components/Client Scripts/Abort action when description is empty/ReadMe.md @@ -1,2 +1,2 @@ -When an Incident record is being closed, the system should validate that the Description field is not empty. -If the Description field is blank, the record submission (update) should be aborted, and the user should be prompted to provide a description before closing the incident. +When an Incident record is being closed, the system should validate that the Description field is not empty and state is completed. +If the Description field is blank and state is completed, the record submission (update) should be aborted, and the user should be prompted to provide a description before closing the incident.