First of all you're missing a closing )
in your row above, before the closing ;
Anyways, try this instead:
var vendor_record = record.load({
type: record.Type.VENDOR,
id: 177270,
isDynamic: true
});
var addressSubrecord = vendor_record.getCurrentSublistSubrecord({
sublistId: 'addressbook',
fieldId: 'addressbookaddress'
});
var cityValue = addressSubrecord.getValue({
fieldId: 'country'
});
var cityText = addressSubrecord.getText({
fieldId: 'country'
});
Not sure if you want the value or text of the Country field but simply choose between getValue()
or getText()
, but I printed both in the code above just so you can see. In the case above, cityValue
would output "SE" and cityText
would output "Sweden".