I can't seem to set a custom address when creating...
# suitescript
t
I can't seem to set a custom address when creating a Sales Order. I don't want to add it to the customer record, but rather mimic the behavior of selecting "- Custom -" in the UI and entering a one-off address. No matter what I try, the default address ends up being used. I can set an override but still behind the scenes, the default address is set with an override of the custom address I am trying to use. Any ideas?
b
what are you trying, the usual way is to set the shipaddresslist or billaddresslist and start setting fields like billaddr1 or shipcity
t
I have tried setting shipaddresslist to '', -2, null, undefined. Have tried removing it with removeField. Am then setting the fields like shipcountry, shipaddr1, shipcity, etc.
I am in dynamic mode by the way
If I set shipaddresslist to "", and then set the fields, I get the error "Please enter value(s) for: Ship To"
And if I set shipaddresslist to "" and shipaddress to a formatted version of my address, I get the correct override, but the fields are all blank
Correction - city, State, and Zip are all in there, but the rest are blank
I am wondering if it has to do with ordering of fields with dynamic mode
b
2018.2 or 2019.1
regardless, try using the recommended way of setting the fields on the
shippingaddress
subrecord (vs the legacy body fields) and then replacing the value of the
shipaddress
field with the value of the subrecord's
addrtext
field
👍 1
t
That did it! Thank you very much!
b
was only setting the shippingaddress subrecord necessary, or did you also have to set the shipaddress
t
also had to set the shipaddress
I believe
that is what I ended up doing when it finally worked, can't say if there were other adjustments when debugging it
am on 2018.2 for reference as well