Hi all, I just published an article which I suspec...
# suitescript
n
Hi all, I just published an article which I suspect might be useful to some of us: Scripting NetSuite custom lists can be a pain due to internal ID divergence. What do you do when the internal IDs of your custom list values in Sandbox do not match those in Production? Learn to write robust custom list code that works in all NetSuite environments: https://netsuite-insights.com/2020/09/learn-to-write-custom-list-code-that-works-across-environments/ Have a look, share your thoughts, enjoy!
👍 4
b
Using setText instead may also be an option
n
Interesting thought. How would setText work in this case?
b
Would allow you you to set the field via text value instead of internal id
e
Of course setText is not always perfect as the general idea is that your admin can change text values while internal (or script) IDs are preserved.
@netsuite_insights you said it great that NS - not developers - need to solve this! I always assumed the purpose of script IDs was to address this directly without the overhead... We should be allowed to reference script IDs
👍🏼 1
b
i believe that script id for custom lists was added to support sdf, not specifically suitescript
e
Well it really should
b
probably too late to do it easily, nothing is preventing you from putting numbers in there, so they would need to add functionality that specifically works for custom lists
n
@battk As mentioned by @ec, using setText won't solve the problem but only increase it since any user with edit access to the list can change the text value. Also translations/localization might come into play here.
b
pick your tradeoff, localization generally means that you pick form a larger list of possible values using the language as the lookup key. Both script id and the text value are editable by user. I personally imagine both are unlikely to be edited, though id probably looks scarier to edit to an uninformed user. You just need to decide if the logic and governance associated with the search is preferable to using names.