Hello, how do I set the shipaddresslist field on a...
# suitescript
p
Hello, how do I set the shipaddresslist field on a salesorder? I have a script that looks up a specific address on the customer record through a search. I get the following error Invalid shipaddresslist reference key 238211 for entity 13051.
b
i dont think you do anything special, using setValue on the
shipaddresslist
with the internal id of the address should work fine
is the address with internal id 238211 an address from the customer record with internal id 13051
p
thats correct
but I still get an error when trying to set the internal id
message has been deleted
b
you should probably be looking at the customer record, not your search
p
what do you mean?
I do a lookup on the customer record for the correct address and then try to set the internal id
b
the address subrecord is stored on the customer record
the internal ids are from there
p
var myCustTransColFieldfromSO = searchResults[0].getValue('internalid','address');
b
usually on the address subtab
p
is it the internal id field I need or the id field?
it looks like my search is returning the internal id correctly of the address from the customer record but I am unable to set the fieldvalue for the shipaddresslist field
b
you should be using the
address internal id
column
not the internal id from the address join
basically, you should be using whatever id is shown on the customer records address subtab
p
got it
thanks for your help. it worked