function validateRequiredFields(object) {
	_.forEach(object, function(field) {
		// This check ensures a required field's value is not NaN, null, undefined or empty. Zero is valid, but the data type check will make sure any fields with 0 are numeric.
		if(field.required === true && (_.isNaN(field.value) || _.isNull(field.value) || _.isUndefined(field.value) || field.value.toString().length === 0)) {
			throw new nACHError({
				name: 'Required Field Blank',
				message: field.name+' is a required field but its value is: ' + field.value
			});
		}
	});

	return true;
}
// Validate required fields to make sure they have values
Validate required fields to make sure they have values
Validate required fields to make sure they have values
function validateRequiredFields(object) {
	_.forEach(object, function(field) {
		if(field.required === true && (_.isNaN(field.value) || _.isNull(field.value) || _.isUndefined(field.value) || field.value.toString().length === 0)) {
			throw new nACHError({
				name: 'Required Field Blank',
				message: field.name+' is a required field but its value is: ' + field.value
			});
		}
	});
	return true;
}
function validateRequiredFields ( object ) { _ . forEach ( object , function ( field ) { if ( field . required === true && ( _ . isNaN ( field . value ) || _ . isNull ( field . value ) || _ . isUndefined ( field . value ) || field . value . toString ( ) . length === 0 ) ) { throw new nACHError ( { name : 'Required Field Blank' , message : field . name + ' is a required field but its value is: ' + field . value } ) ; } } ) ; return true ; }
Validate required fields to make sure they have values
Validate required fields to make sure they have values
// This check ensures a required field's value is not NaN, null, undefined or empty. Zero is valid, but the data type check will make sure any fields with 0 are numeric.