I created Browser.inputBox
which accepts only a single text. However I need to make a drop down list where I can choose from the list instead of typing the string myself.
The following is the screenshot of the inputBox I created on clicking Odoo(in menu bar)>Settings.
Here is the function that is being triggered:
function menu_settings(params) {
if (!params){
params = [["url", "URL"], ["dbname", "Database Name"], ["username", "username"], ["password", "password"]];
}
for (var i = 0; i < params.length; i++){
var input = Browser.inputBox("Server Settings", params[i][1], Browser.Buttons.OK_CANCEL);
if (input === "cancel"){
break;
}
else{
ScriptProperties.setProperty(params[i][0], input);
}
}
}
Basically instead of typing the text, I need a drop list with predefined values.
I was checking the Browser class and I saw there is no such drop down list option. Most solutions that I have seen use DataValidation from texts input in the cells. But I want to give the list for the dropdown in my code and nothing on the spreadsheet. How do I implement this? I'm a newbie at this so I need some advice!
Thanks!