//Primary Custom Code - Start
function IMMValidateForm()
{
  	var excludedFields = ['A_NAME','C_NAME','O1_NAME','O2_NAME','LO1_NAME','NUMERIC_FIELD_1','NUMERIC_FIELD_2','NUMERIC_FIELD_3','NUMERIC_FIELD_4','NUMERIC_FIELD_5','NUMERIC_FIELD_6'];
    //Implementation of filling empty text fields with "N/A"

    //Adding sequential excludedFields
  	for (var i = 1; i <= 3; i++){
  		excludedFields.push('DATE_FIELD_'+i);
  		excludedFields.push('PHONE_FIELD_'+i);
  		excludedFields.push('TIN_FIELD_'+i);
  	}

    try{
      for(var i = 0; i < this.numFields; i++){
        var curFieldName = this.getNthFieldName(i);
        var curFieldObj = this.getField(curFieldName);
        var curFieldObjType = curFieldObj.type;

        if (curFieldObjType == 'text' || curFieldObjType == 'combobox' ){ //Checks if it is a text field or drop-list
		  var fieldVal = JSTrim(curFieldObj.value); //Trims whitespace at front and end 
          if (excludedFields.indexOf(curFieldName) == -1 && fieldVal == ''|| fieldVal == '[None]'){ //Checks if field name is not a name field and is empty
            curFieldObj.value = 'N/A';
          }
        }
      }
    } catch(err) {
	  app.alert("Was not able to fill empty text fields with N/A. \r\n + Error: " + err);
	  }
    
    return true;
}
//Primary Custom Code - End