Hi Bala,
In that case, the revised code is as follows:
var today = APPLICATION.getInfo().dateNowInternalFormat;
var month = Convert.stringToInt(today.substring(4,6));
var yearYY = today.substring(2,4);
var yearYYYY = today.substring(0,4);
var quarter = Math.ceil(month/3);
var qArrays = ["Q1","Q1;Q2","Q1;Q2;Q3","Q1;Q2;Q3;Q4"]; // Arrays of quarters per quarter
var quarterArray = qArrays[quarter - 1]; // Get array string of quarters based on current quarter
var quarterList = quarterArray.split(";"); // Convert string to array
// Loop through quarters to date and add to listbox
quarterList.forEach(function(quarterItem, quarterKey) {
LISTBOX_1.addItem(yearYYYY + (quarterKey + 1), quarterItem + " - " + yearYY);
});
When you subsequently apply DD1.getSelectedValue(), the quarter key should be returned in the required YYYYQ format.
Regards,
Mustafa.