Hello, I am trying to validate the address fields ...
# suitescript
p
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; }
b
expect to share what isnt working
in basically all questions you ask
p
the true part is not working when saving an address record
it does not save the record
b
as in its not returning true?
p
it looks like it yes.
b
use a debugger statement to activate the debugger