From d1421199743f4fa7d9c6c96e5911bae054012e45 Mon Sep 17 00:00:00 2001 From: tab22 <30366222+tab22@users.noreply.github.com> Date: Mon, 27 Oct 2025 09:11:42 +0000 Subject: [PATCH 1/2] Create infomessage.js --- .../infomessage.js | 42 +++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 Client-Side Components/Client Scripts/Client Side Popup Message Zurich/infomessage.js diff --git a/Client-Side Components/Client Scripts/Client Side Popup Message Zurich/infomessage.js b/Client-Side Components/Client Scripts/Client Side Popup Message Zurich/infomessage.js new file mode 100644 index 0000000000..849b6cf4f4 --- /dev/null +++ b/Client-Side Components/Client Scripts/Client Side Popup Message Zurich/infomessage.js @@ -0,0 +1,42 @@ +function onSubmit() { +var changeType = g_form.getValue('type'); +var risk = g_form.getValue('risk'); +var state = g_form.getValue('state'); +var implementationPlan = g_form.getValue('implementation_plan'); + +// Validate mandatory field +if (!implementationPlan) { +g_form.addErrorMessage('Implementation plan is mandatory before submission.'); +return false; +} + +// Informational message when in planning state +if (state == '-5') { +g_form.addInfoMessage('Change is currently in planning. Please ensure risk assessment is complete.'); +} + +// Display colour-coded messages based on risk +switch (risk) { +case '1': +g_form.addErrorMessage('Critical Risk Change - Requires CAB and Director approval.'); +break; +case '2': +g_form.addHighMessage('High Risk Change - Requires CAB review.'); +break; +case '3': +g_form.addModerateMessage('Moderate Risk Change - CAB notification needed.'); +break; +case '4': +g_form.addLowMessage('Low Risk Change - Auto approval possible.'); +break; +} + +// Display success/info messages based on change type +if (changeType == 'Emergency') { +g_form.addSuccessMessage('Emergency Change - Proceed with immediate authorization.'); +} else { +g_form.addInfoMessage('Standard Change - Follows the normal approval workflow.'); +} + +return true; +} From 0d49187b1fb28e8f7cf4dbf8e032ca3d3c2387d0 Mon Sep 17 00:00:00 2001 From: tab22 <30366222+tab22@users.noreply.github.com> Date: Mon, 27 Oct 2025 09:14:52 +0000 Subject: [PATCH 2/2] Create README.md --- .../Client Side Popup Message Zurich/README.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 Client-Side Components/Client Scripts/Client Side Popup Message Zurich/README.md diff --git a/Client-Side Components/Client Scripts/Client Side Popup Message Zurich/README.md b/Client-Side Components/Client Scripts/Client Side Popup Message Zurich/README.md new file mode 100644 index 0000000000..8fa07cdf07 --- /dev/null +++ b/Client-Side Components/Client Scripts/Client Side Popup Message Zurich/README.md @@ -0,0 +1,13 @@ +# Zurich info Message Example (Change Management) + +# Overview +This Client Script demonstrates how to use the Zurich release info message types to provide real-time, colour-coded user feedback on the form. +It dynamically displays messages based on the record's Risk, Type, and State, improving visibility and user experience. + +# Objective +To utilise Zurich's enhanced 'g_form' messaging APIs to display meaningful, colour-coded messages: +- Highlight mandatory fields +- Indicate workflow stage +- Provide feedback for risk and change types + +Note: This can also be used in Incident, Problem, Request and other types of records.