I need to access the billing address from a custom...
# suitescript
m
I need to access the billing address from a customer. I am confused about how to do it. Since addressbook seems to be a subrecord but from the customer I guess i can access some fo the fields like
entity.getSublist("addressbook","addressbookaddress",<index>)
to get the addressbookaddress ID but I am guessing I should use that key to search for some other ADDRESS BOOK record to obtain addr1 addr2 city , etc. The problem is that there is no
search.Type.ADDRESSBOOK
or anything like it. What is the correct approach to get teh billing address for a customer or vendor?
e
You can pull in
address1
city
etc using search columns for your customer search, and use a filter of
isdefaultbilling = 'T'
m
👍
s
const billingAddr = _.find(customer.addressbook, a => a.defaultbilling == true)
is basically how I'd do it rather than a search. I think that
defaultxxx
flag is a boolean?