https://netsuiteprofessionals.com logo
#suitescript
Title
# suitescript
a

Andrew Luke

04/18/2022, 3:21 PM
Anyone know how to add and set a new custom ship to address on an SO line with Line Item shipping turned on? Having a hard time figuring out where this list is stored to add a new one to it. The value on the so line is just the internal id of an address. Can't seem to add an address to iladdrbook for some reason.
b

battk

04/18/2022, 3:29 PM
are you trying to add an address to to the customer?
or set the custom address of the item line?
a

Andrew Luke

04/18/2022, 3:29 PM
set the custom address. But it's just being copied from the customer
b

battk

04/18/2022, 3:31 PM
the custom address is done via a subrecord
a

Andrew Luke

04/18/2022, 3:31 PM
subrecord on the item line or iladdrbook line?
b

battk

04/18/2022, 3:37 PM
your sales order shouldnt have a sublist named iladdrbook
a

Andrew Luke

04/18/2022, 3:42 PM
It does, any idea why? I haven't been able to access any subrecord on the line item
b

battk

04/18/2022, 3:46 PM
what does your code look like
a

Andrew Luke

04/18/2022, 3:49 PM
currently trying to get this to work. For some reason the new iladdrbook line does not save. getting the line count before and after shows that a new line is being added, but no new line is actually added on the record.
b

battk

04/18/2022, 3:51 PM
same as before, you need to work with the address subrecord on the item line
s

Shawn Talbert

04/18/2022, 3:51 PM
Copy code
const so = new SalesOrder(123)
so.shippingaddress.addr1 = '123 Elm Street'
(NFT)
a

Andrew Luke

04/18/2022, 3:59 PM
Any idea what that subrecord might be called? This doesn't work
b

battk

04/18/2022, 4:02 PM
same thing as the body level field actually
there is the shipaddress, which represents the text of the entire address
and shippingaddress, which is the actual subrecord
s

Shawn Talbert

04/18/2022, 4:02 PM
sorry, for line level it's something like
so.item[0].shippingaddress.addr1
a

Andrew Luke

04/18/2022, 4:10 PM
Think I figured it out, thanks so much for the help guys. Really appreciate it.