Is there a way to get a list of all available reco...
# suitescript
b
Is there a way to get a list of all available record types? I want to create a custom field where a user can choose a record type. I then want to use that value in a script to create a search. I know there is already a Record Type option for list/record fields, but the values are internal IDs. I want the script ID of the record type, not the internal ID.
b
Use
The Scripted Record Type
type as your
Record Type
🎖️ 1
Then use sourcing to get the value of its Search Type field into another field
and then use that field for your search
you might need to also source the Script ID if you want to support custom records
b
That works! Thanks. I didn't even know Scripted Record Type existed.
b
i only know if it because people in this channel are doing weird things
n
var customRecordSearch= search.create({
type: "customrecordtype",
filters: ['isinactive', 'is', false],
columns: ['scriptid', 'name']
});
var res= customRecordSearch.run();
var results = res.getRange({
start: 0,
end: 10
});
🎖️ 1
This what you're after?
@burkybang
b
@NElliott I was thinking of creating the field via a UE, so that would have helped partially just for the custom records. This does look super handy, however. I might use this for something else in the future. Is there a way to get all of the standard record types that way? I doubt there is.
n
@burkybang record.Type or search.Type could be what you're after. You can reference that directly:
🎖️ 1
b
Oh true. I didn't think about using the Enum.