``` details: "Please enter value(s) for: Address",...
# suitescript
c
Copy code
details: "Please enter value(s) for: Address",
Anyone know which field that's referring to when trying to add an address to the addressbook on a customer record? According to the record browser, the addressbook sublist has a label of Address but each field is non-mandatory so I'm not sure exactly what's being asking for.
b
probably refers to the addressbookaddress subrecord itself
each field of the address may not be mandatory, but the address subrecord itself is mandatory
c
Each field within addressbookaddress is also non-mandatory
I can populate a more full address and see what happens.
b
you can probably get away with only setting the country
c
I'm setting the country on the addressbook but not the addressbookaddress
b
that sounds wrong
c
Copy code
customer.setSublistValue({sublistId: "addressbook", fieldId: "country", line: 0, value: 'AU'});
b
very wrong
c
ha
b
address fields are on the address subrecord
c
I think the way the record browser shows the fields was just confusing
message has been deleted
Maybe that's just visualising the fields inside the addressbookaddress
b
nothing good comes from setting field you would not set in the ui
c
Would I need to getSublistValue on addressbookaddress first?
you have to use the subrecord version
👍 1
c
yeah I see it, thanks
s
or simplify with NFT -
customer.addressbook[0].addressbookaddress.country = 'XX'