Leading on from my <previous question>, has anyone...
# suitescript
y
Leading on from my previous question, has anyone come across the error "Invalid shipaddresslist reference ABC" when you have more than 1 address with the same label? (i.e. running the below script once is fine, but running it again with the same input data fails). Aside from having to increment the labels everytime, is there a better solution? Understandable that it should throw that error, but our requirements unfortunately are to have a new address created every time a change is made, even if it's minor (e.g. fixing spelling etc.). Code snippet in the comments of this thread 🙂 thanks all
e
Are you doing anything with customer addresses on the customer record other than collecting them? You can create a custom address that's associated with the transaction which will be stored in the custom address book rather than in the customer address book.
y
@Eric B I think they're just collecting them and basically are asking me to follow the same outcome. The thing is I can see that it's being done by a third party system, so I feel like it must be possible somehow 😕 I think the approach you mentioned was what I was doing to start with
RESTlet.js
I just had an idea - a bit hacky but if I added some random string to the end of the label everytime, then went back and just updated the label, after saving the order? I'm not sure if that's the best idea but at least if it works it might achieve what the business are after 🙂
b
my original advice remains
get the id of the addressbook line
you are learning one of the reasons text is unfavored
y
@battk I was wondering about that, cos I noticed I needed the addressid, but from what I could see / try, that field wasn't exposed to the API, so the next best thing for me was to do it through text. Is there a way however to access that field? I was advised it wasn't available, and there was an enhancement request to NetSuite for something like this, but it wasn't just yet actioned
b
the addressbook id is available to record search and query modules
the only thing you really need to watch out for is that there is the id of the address and the id of the addressbook line
you want the id of the addressbook line
y
Ahhhhh that's very interesting!!! In that case I may just do that, the text method seems far more limited. I'm excited that I can actually grab that out now haha