What would be the better way to validate addresses...
# suitescript
k
What would be the better way to validate addresses on vendors and customers? I was thinking of a clientscript that would raise an alert when the address fields are not valid. I am not able to read the address fields with this method.
b
what did your attempt look like
k
I tried the following from a vendor record
var currentRecord = context.currentRecord;
var addressSubrecord = currentRecord.getCurrentSublistSubrecord({
sublistId: 'addressbook',
fieldId: 'addressbookaddress'
});
let country = addressSubrecord.getText({
fieldId: 'country'
});
But country is always undefined, and the other fields too.
b
looks reasonable beyond the usage of getText instead of getValue
you probably want to make sure you put this on an entrypoint that only runs on addressbook lines