on 01-13-2014 9:52 AM
Hi all,
I have a dropdown box which gets values from datasouce in the following way:
DROPDOWN_YR.setItems(DS_1.getMemberList("0CALYEAR", MemberPresentation.EXTERNAL_KEY, MemberDisplay.TEXT, 5));
The result I get is: 2010, 2011, 2012, 2013, 2014.
I want to display only last 3 years: meaning: 2012, 2013, 2014.
Is there a way to sort the result in a descending order and filter only last 3 years?
Or - is there another way to achieve this goal?
Thanks,
Hagit
Hi Hagit,
I can't check it right now, but it seems you can use sort(false), for descending order and maxNumber parameter to 3 in order to limit the list to three values.
Thanks,
eitan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Hagit,
I do not know of any sorting functionality in script Eitan is mentioning.
However, if you are only using the last 3 years, you would probably be better off from a performance point of view to filter in your BEx query on the last 3 years (using variables ofcourse).
Kind regards,
Sjoerd
Hi Eitan,
The sorting applies to the dropdown box, not to the datasource. The values are already in the dropdown box when you sort, so too much values are present at that time already. Unfortunately, there's no script function to limit the number of values in the dropdown box, other than the setItems option.
Kind regards,
Sjoerd
Sjoerd - another thing regarding your suggestion: " you would probably be better off from a performance point of view to filter in your BEx query on the last 3 years"
I've noticed that although my variable related to specific years, the values arrive to the dropdown are different, I get the whole years available in my DSO.
My variable is interval of previous to current year, but the dropdown list shows all years between 2010 and 2014.
please take a look at the screenshot attached:
Hi Sjoerd,
The variable is a customer exit which calculates the current year.
The problem is that the characteristic 0CALYEAR relates to the posted values, so actually it displays all values available in my info-provider.
If you look in the screenshot I've attached in my previous post you will notice that design studio related to the left list of years.
Can I save the result in a temporary array and than pass the values I need to the dropdown?
Thanks again,
Hagit
User | Count |
---|---|
78 | |
9 | |
9 | |
7 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.