ericbirdsall
08/12/2021, 6:31 PMericbirdsall
08/12/2021, 6:31 PMfunction warnMissingBillingInfo() {
try {
var billingSubrecord = orderConfirmation.getSubrecord('billingaddress')
var billCity = billingSubrecord.getValue('city');
var billState = billingSubrecord.getValue('state');
var billZip = billingSubrecord.getValue('zip');
if (!billCity || !billState || !billZip) {
Swal.fire({
title: 'Do you want to save the changes?',
html: `The bill to address is missing either the City, State, or Zip Code. <br><br>Press Cancel to make changes. Press OK to continue.`,
showDenyButton: true,
denyButtonText: `Cancel`,
}).then((result) => {
console.log('result', result);
if (result.isConfirmed) {
console.log('should be true');
return true;
} else if (result.isDenied) {
console.log('should be false');
return false;
}
});
} else {
return true;
}
} catch (error) {
log.error('error from warnMissingBillingInfo', error);
library.sendErrorEmail(error, 'CSOC_MAIN warnMissingBillingInfo');
}
}
ericbirdsall
08/12/2021, 6:31 PMbattk
08/12/2021, 6:34 PMbattk
08/12/2021, 6:34 PMericbirdsall
08/12/2021, 6:38 PMericbirdsall
08/12/2021, 6:38 PMbattk
08/12/2021, 6:45 PMericbirdsall
08/12/2021, 6:49 PM