SuiteScript 2.1 -- attempting to set a custom fiel...
# suitescript
s
SuiteScript 2.1 -- attempting to set a custom field which is of type List/Record: Country. I can set either "US" or "United States". Are either of these valid values?
code example:
myCustomRecord.setValue({
fieldId : listRecordCountryFieldId,
value : 'US'
});
a
Country code and state codes behave differently in different types of record even if they use the same List/Record type, you may need to get the real country code to set the country in some scenarios.
This function using the query module is going to return the country code and country id and it would dynamically accept the country code or id...
Untitled.js
b
you should be able to use setText with the name of the country instead
a
As a personal preference I never ever use setText…