Has anyone ever been able to determine what type o...
# suitescript
t
Has anyone ever been able to determine what type of List/Record a Select field is referencing with SuiteScript? At this point, I don’t care what context it is - UE, CS, MR, whatever.
s
I dont believe you can directly get the source, you can only get the select options and infer the source.
t
That’s what I was afraid of 😔
s
just curious, why would you need to get the source?
t
I need to get the select options for a select field but I can only return 1000 with getSelectOptions, so I was trying to come up with a way to get the record type that the Select field is referencing so I could do a search of that record instead
s
Do you not already know what the source is, is this for some util/shared library instead? It seems weird to know what the field is but not know what is in it or where its coming from
t
It’s a tool that allows a person to add dynamic columns so I have no way of knowing what field/record will be added ahead of time
s
I've done something similar in the past, if you want to build the tool to allow them to add any field, then add another field for source to your custom record (I assume it's built on some custom record?)
t
It is built on a custom record. The less-ideal option I have is to add a field that would need to hold the internal id of the list/record for the select field. I don’t love the idea of needing to have that info manually added in because it adds a lot of room for the wrong data or other weird issues. I tried coming up with a way to add a select field based on the Field list/record, selecting a value from that select field, and having a second field automatically source the list/record from the field that was selected but I had no luck with it.
s
Yeah I'm not sure there is a better way, I personally went with adding a source field to the custom record
t
I think that will be the direction I end up going in too. Thanks for your help @Sandii!
b
the analytics data source used by workbooks expose custom field definitions
you can get the
List/Record
from there