Any way to return a list value script ID in a save...
# suitescript
b
Any way to return a list value script ID in a saved search?
c
You can try a Formula result field and enter the field name appended by
.id
like so:
Copy code
{salesrep.id}
I'm not sure if this works for all List/Record field types
b
I know about that trick already. That returns the internal ID, not the script ID.
c
Oh I misread your question
b
No worries
c
Do you mean the script ID for the list itself?
b
No, the script ID of the list values
c
I guess I'm not following. As far as I can tell, individual list entries have a Value and an internal ID, but no script ID. Could you provide an example?
b
Yeah, you can add a script ID to list items too. Go to the list of custom lists in (Customization -> List, Records, & Fields -> Lists). On the row of a list, click on List at the far right. It will take you to a view of all the list items. Edit one of those list items. There you will see the Script ID. You can click the Change ID button to change it.
This is helpful to use because it will be consistent across any other NetSuite accounts. Whereas the internal ID might not be
Right now, I'm using the text because that is also consistent (for now), but I'm worried what could happen if someone adds translations.
c
That's great! Thanks for showing me 👍 Are these IDs required to be unique across all list items, or just within the particular list they belong to?
b
Good question
The other option I can do is look them up via my script by loading the list as a search, but it's just a bit more expensive with governance. I was hoping maybe my initial search could do it.
c
I just tested it, and script IDs need to be unique for the list, not across all custom lists -- i.e. I was able to reuse the same script ID for a value in List A and a value in List B, but not for two different values in List A.
b
Makes sense
b
do a search for the list?
b
Yeah, that's what I was suggesting above.
The other option I can do is look them up via my script by loading the list as a search, but it's just a bit more expensive with governance. I was hoping maybe my initial search could do it.