Mayesh Nadesan
02/25/2025, 6:30 AMCeligo AI
02/25/2025, 6:30 AMAI generated answer (using internal Slack threads):To get the name from a classlist id inside a restlet in JavaScript, you can use the SuiteScript API's
search.create
method. This method allows you to create a search on a specific record type, in this case, the custom list. You can then specify the columns you want to retrieve, which would be 'internalid' and 'name'.
Here is a sample code snippet that was shared in the conversation:
javascript
let res = search.create({
type: 'customlist_idhere',
filters: [],
columns: ['internalid', 'name']
}).run().getRange(0,100).map(res => res.toJSON().values)
In this code, replace 'customlist_idhere' with the internal id of your custom list. This will return an array of objects, each containing the 'internalid' and 'name' of the items in the list.
Please note that this code will only return the first 100 results due to the getRange(0,100)
method. If your list contains more than 100 items, you will need to implement pagination to retrieve all the results.
Also, you may want to add a filter on isinactive
to only retrieve active items from the list.
******
Disclaimer:
This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes.
******Celigo AI
02/25/2025, 6:30 AMSlack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.77852428
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.773851216
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.772557795
Celigo AI
02/25/2025, 6:30 AM