Hey! I am working on understanding SuiteQL more an...
# suiteql
z
Hey! I am working on understanding SuiteQL more and am working on something where I want to pull the shipping address from a customer record. To do that, I need to get the lines off the addressbook with the condition that defaultshippingaddress is marked as 'T'. From that, I can get the addressbookaddress value and load the 'customeraddressbookentityaddress' table all fine. I am stuck on how to get the individual lines to apply the condition I mentioned. Thank you for your time!
I had accidentally posted this in general but I have been working on this all morning. I finally figured it out so I wanted to leave the question for if anyone needs it.
Copy code
c.id,
abl.addressbookaddress,
abl.entity,
ca.addr1,
ca.addr2,
ca.addr3,
ca.city,
ca.state,
ca.zip,
ca.country
FROM customer c
LEFT JOIN customeraddressbook abl ON abl.defaultshipping = 'T' AND abl.entity = c.id
LEFT JOIN customeraddressbookentityaddress ca ON nkey = abl.addressbookaddress
WHERE id = ?