Loading

Make Close Note Mandatory

From ServiceNow Wiki
Home > Script > Useful Scripts > Make Close Note Mandatory
Jump to: navigation, search


As-is functionality
Caution: The customization described here was developed for use in specific ServiceNow instances, and is not supported by ServiceNow Customer Support. This method is provided as-is and should be tested thoroughly before implementation. Post all questions and comments regarding this customization to our community forum.

Name: Make Close Note Mandatory

Type:

Table: incident

Description: This script makes the Close Notes field on a form mandatory when clicking the submit button to close.

Parameters:

Script:
function onSubmit() {       
  var action = g_form.getActionName();     
  var inc_state = g_form.getValue('incident_state');
 
  if (action == 'close_incident' || inc_state == '6' || inc_state == '7') { 
    var close_note = g_form.getValue('close_notes');                  
    if (close_note == '') {
      alert('Close Notes are mandatory!');             
      g_form.setMandatory('close_notes', true);             
      return false;           
    }          
  }         
}
Was this article helpful?
Yes, I found what I needed
No, I need more assistance
Views
Personal tools