Anyone know how to add and set a new custom ship t...
# suitescript
a
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
are you trying to add an address to to the customer?
or set the custom address of the item line?
a
set the custom address. But it's just being copied from the customer
b
the custom address is done via a subrecord
a
subrecord on the item line or iladdrbook line?
b
your sales order shouldnt have a sublist named iladdrbook
a
It does, any idea why? I haven't been able to access any subrecord on the line item
b
what does your code look like
a
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
same as before, you need to work with the address subrecord on the item line
s
Copy code
const so = new SalesOrder(123)
so.shippingaddress.addr1 = '123 Elm Street'
(NFT)
a
Any idea what that subrecord might be called? This doesn't work
b
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
sorry, for line level it's something like
so.item[0].shippingaddress.addr1
a
Think I figured it out, thanks so much for the help guys. Really appreciate it.