having a custom list "fruit" with values: apple in...
# suitescript
l
having a custom list "fruit" with values: apple internal id 1, orange internal id 2, banana internal id 3. I have id 2, how to get the name "orange"? thank you!!
e
If you are using
getValue
it gives you the ID. Using
getText
retrieves the text.
l
e
It depends. What are you trying to do? Do you need to get all the texts from a Custom List in a script?
r
Is the list part of a custom record? what record type are you dealing with? what script type are you using?
l
just need a single value knowing list member internal id.
the list is sourced by a custom field of a custom record. is there a better way to find value? I already get the record custom field value, it returned an internal id. I need to search the list value by id.
r
you just want to get the value on a particular custom record? when?
an instance of a custom record would only have one value. is that what you're after?
getText
like @Edgar Valdes said
l
getText on the custom record field? so i don't have to touch the list record?
let me try. thanks.
r
i'm assuming you're using
Record.getValue()
(capital R meaning an instance of the record type). you want to use
Record.getText()
https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/section_4273156769.html#bridgehead_4447655232
l
🙏 worked.
wasted 2 hours writing my own getText() functions🤣
👍 1