Hi everyone, I am having the issue of blank State ...
# suitescript
h
Hi everyone, I am having the issue of blank State when trying to set the Address subrecord on Customer. I've tried "setValue" and "setText" but none works so far (The "shipState" is a string) . The other fields work just fine but not the State field. Not sure what am I missing? TIA
Copy code
addressSubrecord.setValue({
	fieldId: 'state',
	value: shipState
});
a
are you trying to set it to AZ? I think you need to set it to Arizona and the two letter abbreviation happens automatically
thanks 1
s
ensure you set country first, then state to the 2 letter code.
thanks 1
using setValue()
h
Ahh, setValue to the 2 letter code works like a charm. Thanks both ❤️
a
oh so just totally the opposite of what I suggested... you're welcome 😅
😆 3
b
depends on the accounts, some are setup to use freeform states, some do abbreviations