Hello, I am trying to validate the address fields from the transaction forms and I am running into an issue when an address is trying to be saved. What can I do to fix it? define(['N/record','N/log'], function(record,log) {
function saveRecord(scriptContext) {
var url = window.location.href; //(please note that NetSuite doesn't recommend and encourage to use this. Neither it guarantees its functionality)
//var objRecord = scriptContext.currentRecord;
var isVendor = url.search('vendor');
console.log('isVendor: ' + isVendor)
//log.debug({details:"isVendor " + isVendor});
//log.debug({details:"entityval " + entityval});
if(isVendor == -1) {
return true;
} else {
alert('You can not create or edit an address from the Vendor Bill Record');
return false;
}