File tree Expand file tree Collapse file tree 1 file changed +42
-0
lines changed Expand file tree Collapse file tree 1 file changed +42
-0
lines changed Original file line number Diff line number Diff line change 1+ function onSubmit ( ) {
2+ var changeType = g_form . getValue ( 'type' ) ;
3+ var risk = g_form . getValue ( 'risk' ) ;
4+ var state = g_form . getValue ( 'state' ) ;
5+ var implementationPlan = g_form . getValue ( 'implementation_plan' ) ;
6+
7+ // Validate mandatory field
8+ if ( ! implementationPlan ) {
9+ g_form . addErrorMessage ( 'Implementation plan is mandatory before submission.' ) ;
10+ return false ;
11+ }
12+
13+ // Informational message when in planning state
14+ if ( state == '-5' ) {
15+ g_form . addInfoMessage ( 'Change is currently in planning. Please ensure risk assessment is complete.' ) ;
16+ }
17+
18+ // Display colour-coded messages based on risk
19+ switch ( risk ) {
20+ case '1' :
21+ g_form . addErrorMessage ( 'Critical Risk Change - Requires CAB and Director approval.' ) ;
22+ break ;
23+ case '2' :
24+ g_form . addHighMessage ( 'High Risk Change - Requires CAB review.' ) ;
25+ break ;
26+ case '3' :
27+ g_form . addModerateMessage ( 'Moderate Risk Change - CAB notification needed.' ) ;
28+ break ;
29+ case '4' :
30+ g_form . addLowMessage ( 'Low Risk Change - Auto approval possible.' ) ;
31+ break ;
32+ }
33+
34+ // Display success/info messages based on change type
35+ if ( changeType == 'Emergency' ) {
36+ g_form . addSuccessMessage ( 'Emergency Change - Proceed with immediate authorization.' ) ;
37+ } else {
38+ g_form . addInfoMessage ( 'Standard Change - Follows the normal approval workflow.' ) ;
39+ }
40+
41+ return true ;
42+ }
You can’t perform that action at this time.
0 commit comments