Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 2161

Re: Dynamic filter in listbox using Timer SDK component

$
0
0

Hi Naveen,

 

There is no need to incur the extra overhead of using a Dropdown and setItems each time the timer code is triggered.  Instead, you can simply store the key/text pairs in the WarehouseList string by modifying your code as follows:

 

// Warehouse List Definition

 

var myWarehouses = DS_2.getMembers(<WAREHOUSE_DIMENSION>,100);

 

WarehouseCount = myWarehouses.length;

 

myWarehouses.forEach(function(element, index) {

  WarehouseList = WarehouseList + element.internalKey + ":" + element.text + "|";

});

 

 

 

"On Timer" event script of TIMER1_DS2:

 

var WarehouseArray = WarehouseList.split("|");

var WarehouseValuePair = WarehouseArray[WarehouseCounter];

var WarehouseValuePairArray = WarehouseValuePair.split(":");

 

var WarehouseKey = WarehouseValuePairArray[0];

var WarehouseText = WarehouseValuePairArray[1];

 

DS_2.setVariableValue("V_Warehouse", WarehouseKey);

DS_2.setVariableValue("P_StartDate", APPLICATION.getInfo().dateNowInternalFormat);

DS_2.setVariableValue("P_EndDate", APPLICATION.getInfo().dateNowInternalFormat);


TEXT_5.setText(WarehouseText);

 

 

Regards,

 

Mustafa.


Viewing all articles
Browse latest Browse all 2161

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>