Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
21b615f
Code for Moveworks bot messages for Flow to include url links
Suri123789 May 27, 2025
3f59723
Create script.js
Suri123789 Oct 28, 2025
4de6213
Create readme.md
Suri123789 Oct 28, 2025
471a32b
Merge branch 'main' into Hactoberfest-2025-1st-pull-request
Suri123789 Oct 28, 2025
2903979
Delete Client Scripts/validate Interaction record/readme.md
Suri123789 Oct 28, 2025
08744d3
Delete Moveworks messages html for Flow
Suri123789 Oct 28, 2025
598bfd9
Create readme.md
Suri123789 Oct 28, 2025
48f9b74
Merge branch 'ServiceNowDevProgram:main' into Hactoberfest-2025-1st-p…
Suri123789 Oct 28, 2025
47210fd
Merge branch 'ServiceNowDevProgram:main' into Hactoberfest-2025-1st-p…
Suri123789 Oct 28, 2025
820c0ba
Merge branch 'ServiceNowDevProgram:main' into 2nd-pull-request-2025
Suri123789 Oct 29, 2025
2b9f82a
Create script.js
Suri123789 Oct 29, 2025
3636380
Create readme.md
Suri123789 Oct 29, 2025
ac43b58
Delete Client Scripts/validate Interaction record/readme.md
Suri123789 Oct 29, 2025
4533870
Delete Client Scripts/validate Interaction record/script.js
Suri123789 Oct 29, 2025
a5b97fc
Create script.js
Suri123789 Oct 29, 2025
00436aa
Create readme.md
Suri123789 Oct 29, 2025
5a0e77c
Update script.js
Suri123789 Oct 29, 2025
8e52c44
Create script.js
Suri123789 Oct 29, 2025
4ded45c
Create readme.md
Suri123789 Oct 29, 2025
e068b3a
Delete Server-Side Components/Business Rules/Auto-assignment based on…
Suri123789 Oct 29, 2025
88818d7
Delete Server-Side Components/Business Rules/Auto-assignment based on…
Suri123789 Oct 29, 2025
9b053c4
Delete Client-Side Components/Client Scripts/validate Interaction if …
Suri123789 Oct 29, 2025
d3020d8
Delete Client-Side Components/Client Scripts/validate Interaction if …
Suri123789 Oct 29, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
README — Client Script: Validate Interaction Resolution
📌 Purpose
This Client Script ensures proper validation when resolving an Interaction record in ServiceNow.
It prevents a user from marking an Interaction as Closed Complete without proper justification.

🎯 What It Does

When a user attempts to submit the form:
✔ Allows submission only if:
Interaction Type is "walkup"
And Related Task Boolean is true

OR

✔ If work notes are provided for First Contact Resolution (FCR)
❌ Prevents submission if:
State = Closed Complete
Work Notes are empty
And no related task condition is met

🧠 Validations Performed
Field Condition Action
state closed_complete Trigger validation
type walkup AND u_boolean_no_related_task = true Submission allowed ✅
work_notes Must not be empty Show error & stop submission ❌
🔔 User Feedback

If work notes are missing:
Displays inline field message

Shows popup alert:
"Provide Worknotes for FCR Interaction"

📍 Script Location

Client Script → Type: onSubmit()
Applicable to Interaction table (interaction)

📌 Script Code
//Client Script to validate an Interaction record is resolved with out any related record created.
function onSubmit() {
var relatedTask = g_form.getValue('u_boolean_no_related_task');
var state = g_form.getValue('state');
var type = g_form.getValue('type');
var workNotes = g_form.getValue('work_notes'); // Get the value of work notes

// Clear previous field messages
g_form.clearMessages();

// Check if state is changing to 'Closed Complete'
if (state == 'closed_complete') {
// Check additional conditions
if (type == 'walkup' && relatedTask == 'true') {
return true; // Allow form submission
} else if (!workNotes) { // Check if work notes is empty
g_form.showFieldMsg('work_notes', 'Provide Worknotes for FCR Interaction', 'error');
alert('Provide Worknotes for FCR Interaction');
return false; // Prevent form submission
}
}
return true; // Allow form submission for other states
}

✅ Benefits

Maintains consistent resolution standards
Ensures justification/documentation for FCR interactions
Reduces incorrect closure of requests without related actions



Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
//Client Script to validate an Interaction record is resolved with out any related record created.
function onSubmit() {
var relatedTask = g_form.getValue('u_boolean_no_related_task');
var state = g_form.getValue('state');
var type = g_form.getValue('type');
var workNotes = g_form.getValue('work_notes'); // Get the value of work notes

// Clear previous field messages
g_form.clearMessages();

// Check if state is changing to 'Closed Complete'
if (state == 'closed_complete') {
// Check additional conditions
if (type == 'walkup' && relatedTask == 'true') {
return true; // Allow form submission
} else if (!workNotes) { // Check if work notes is empty
g_form.showFieldMsg('work_notes', 'Provide Worknotes for FCR Interaction', 'error');
alert('Provide Worknotes for FCR Interaction');
return false; // Prevent form submission
}
}
return true; // Allow form submission for other states
}
Loading