in a suitelet, is it possible to create a select f...
# ask-stanley-ai
b
in a suitelet, is it possible to create a select field where the source is "entity"
c
AI generated answer (using internal Slack threads):
Yes, it is possible to create a select field in a Suitelet where the source is "entity". However, it requires some work. You would need to perform a search and then add select options where the record id is the id in the list and the text value is another column from your search. Here is a general example of how you might do this:
Copy code
javascript
var field = form.addField({
    id: 'custpage_field',
    type: serverWidget.FieldType.SELECT,
    label: 'Entity'
});

var searchResult = entitySearch.run().getRange({
    start: 0,
    end: 1000
});

for (var i = 0; i < searchResult.length; i++) {
    field.addSelectOption({
        value: searchResult[i].getValue({
            name: 'internalid'
        }),
        text: searchResult[i].getValue({
            name: 'name'
        })
    });
}
In this example, an entity search is performed and the results are used to populate the select field options. The internal id of each entity is used as the value and the name of the entity is used as the text. Please note that the way the field is displayed (as a dropdown list or as a search) depends on the user's preferences, specifically the
General > Optimizing NetSuite > Maximum Entries in Dropdowns
preference. ****** Disclaimer: This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes. ******
Slack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.839315951
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.824143589
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.823508441
Please provide your feedback on this answer.