diff --git a/Client-Side Components/Client Scripts/Require comment onPriority change/README.md b/Client-Side Components/Client Scripts/Require comment onPriority change/README.md new file mode 100644 index 0000000000..bcc58a3054 --- /dev/null +++ b/Client-Side Components/Client Scripts/Require comment onPriority change/README.md @@ -0,0 +1,6 @@ +Table: sn_customerservice_case +Type: OnChange +Field: Priority + +Use Case: +Make additional comments mandatory on priority change for the case table. diff --git a/Client-Side Components/Client Scripts/Require comment onPriority change/script.js b/Client-Side Components/Client Scripts/Require comment onPriority change/script.js new file mode 100644 index 0000000000..29aece0c53 --- /dev/null +++ b/Client-Side Components/Client Scripts/Require comment onPriority change/script.js @@ -0,0 +1,10 @@ +function onChange(control, oldValue, newValue, isLoading, isTemplate) { + if (isLoading || newValue === '') { + return; + } + if ((!g_form.isNewRecord()) && (newValue != oldValue)) { + g_form.setMandatory('comments', true); + g_form.addErrorMessage('Additional comment required when changing Priority.'); + } else { + g_form.setMandatory('comments', false); + }