NetSuite uses the ExtJS library for a variety of purposes including showing popup windows for alerts and confirmations. We can make use of this to tailor this popup window for our own uses cases which would otherwise couldn’t be met using the standard ‘N/ui/dialog Module’
Note : We are using the ExtJS library which NetSuite used for building their own popup/modal/dialog purpose. If NetSuite decides to upgrade this library or change this to another library, it may break the existing scripts if we use the ExtJS library directly.
To show a popup window in NetSuite with Select Option
The following code snippet is for the scenario defined below :
The popup window should have the select field with options A, B, C, and a button to confirm/submit. Upon submission, we should retrieve the value selected by the user.
To create a popup window in NetSuite using the ExtJS library with a select field and a submit button, you can use the following code:
// Create a function to show the popup window
function showPopupWindow() {
// Create the select field with options A, B, and C
var selectField = new Ext.form.ComboBox({
fieldLabel: 'Select Option',
store: ['A', 'B', 'C'],
queryMode: 'local',
displayField: 'name',
valueField: 'value',
forceSelection: true,
editable: false
});
// Create the submit button
var submitButton = new Ext.Button({
text: 'Submit',
handler: function() {
// Retrieve the selected value from the select field
var selectedValue = selectField.getValue();
// Perform any desired actions with the selected value
console.log('Selected value:', selectedValue);
// Close the popup window
popupWindow.close();
}
});
// Create the popup window
var popupWindow = new Ext.Window({
title: 'Choose an Option',
layout: 'form',
items: [selectField],
buttons: [submitButton]
});
// Show the popup window
popupWindow.show();
}
// Call the function to show the popup window
showPopupWindow();


This code will create a popup window with a select field containing options A, B, and C, and a submit button. Upon clicking the submit button, the selected value will be retrieved and can be used for further processing.