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