File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed
Client-Side Components/Client Scripts/Validate Interaction record for FCR(First Call Resolution) Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change 1+ //Client Script to validate an Interaction record is resolved with out any related record created.
2+ function onSubmit ( ) {
3+ var relatedTask = g_form . getValue ( 'u_boolean_no_related_task' ) ;
4+ var state = g_form . getValue ( 'state' ) ;
5+ var type = g_form . getValue ( 'type' ) ;
6+ var workNotes = g_form . getValue ( 'work_notes' ) ; // Get the value of work notes
7+
8+ // Clear previous field messages
9+ g_form . clearMessages ( ) ;
10+
11+ // Check if state is changing to 'Closed Complete'
12+ if ( state == 'closed_complete' ) {
13+ // Check additional conditions
14+ if ( type == 'walkup' && relatedTask == 'true' ) {
15+ return true ; // Allow form submission
16+ } else if ( ! workNotes ) { // Check if work notes is empty
17+ g_form . showFieldMsg ( 'work_notes' , 'Provide Worknotes for FCR Interaction' , 'error' ) ;
18+ alert ( 'Provide Worknotes for FCR Interaction' ) ;
19+ return false ; // Prevent form submission
20+ }
21+ }
22+ return true ; // Allow form submission for other states
23+ }
You can’t perform that action at this time.
0 commit comments