'On Error' action in Community

No errors, but I see different things in the console in internal SF vs. the Community.

Internal:

Community:

The Javascript is looking at the difference between today’s date (2018-04-12) and a date field (2018-04-02, in this case) to make sure they are greater than 18 years and throws an error if not.

Here’s what my Javscript looks like (I’m checking to see if a new Patient is less than 18 years old; if so, an alternate contact is required).

$ = skuid.$;

var Patient = skuid.$M(‘PatientAccount’),
thePatient = Patient.getFirstRow();

var bday = Patient.getFieldValue(thePatient, ‘PersonBirthdate’ );
var AltContact = Patient.getFieldValue(thePatient, ‘Alternate_Contact_Name__c’);
var override = Patient.getFieldValue(thePatient, ‘NoAlternateContact’);
var today = skuid.time.getSFDate(new Date());
var millisecondsperday = 24 * 60 * 60 * 1000;
var diff = (skuid.time.parseSFDate(today)-skuid.time.parseSFDate(bday))/ millisecondsperday / 365.2424;

console.log(today);
console.log(bday);
console.log(diff);

returnVal = true;

//Create your conditional statements
if ( AltContact === null && ( diff < 18 ) && override !== true ) {
returnVal = false;
}

return returnVal;