09-21-2017 8:19 PM - edited 02-04-2024 12:33 AM
I have a requirement to show 13 month rolling period where the user will select intially from the Fiscal Year/Period prompt.
I was able to get 13 month rolling periods in a drop down but when the user selects , application forces to enter prompt values and when they select, then only that period values are displaying.
I have Drop Down On select as DS_1.setVariableValueExt("0P_FPER", DROPDOWN_1.getSelectedValue());
Any help is appreciated,
Thanks,
Jothi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Jothi,
How are you populating the dropdown box? It looks like you are using a BEx data source. In that case, I suggest you use setVariableValue() instead of setVariableValueExt() and make sure the dropdown is populated with internal key values of Fiscal Period.
Regards,
Mustafa.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for the reply.
I have a FY Period structure from 0-12 months in BEx query with FYP prompt.
I tried that, still drop down gives me only the month I have selected and not 13 months from the selected month though,
Just like Navigation filter in Analyzer.
DS_1.setVariableValue("0P_FPER", DROPDOWN_1.getSelectedValue());
May the FYP in drop down is not interacting with the prompt I'm entering.
Also, Is there is a way that user doesn't need to enter prompt second time and just get 13 months rolling after selecting month and year from Drop down?.
Thanks,
Jothi
Hi Mustafa,
I have a code that actually brings in LoV's in Drop down box.
I was able to display 13 months rolling after selecting value from drop down, Only issue is after selecting month and year from the drop down, Prompting me to reenter FYP, which I want to bypass.
Here is the warning msg I get when I pick FYP.
Thanks,
Jothi
Here are the details Mustafa,
1) The script code for populating the dropdown box with the LoV and a confirmation of where in the application this code is executed;
Pretty much similar to the code below.
var defaultYear = DS_1.getVariableValueText("0P_FPER"); var defaultYearValue = Convert.stringToInt(defaultYear); var yearMemberKey = ""; var yearMemberKeyValue = 0; var yearMemberText = ""; var yearList = DS_2.getMembers("0FISCPER", 100);
yearList.forEach(function(yearMember, index)
{ yearMemberKey = yearMember.internalKey; yearMemberKeyValue = Convert.stringToInt(yearMemberKey); yearMemberText = yearMember.text;
if (yearMemberKeyValue <= defaultYearValue)
{ DROPDOWN_1.addItem(yearMember.internalKey, yearMember.text); } });
DROPDOWN_1.sort(true); DROPDOWN_1.setSelectedValue(defaultYear);
2) The script code in the "On Select" event of the dropdown box.
DS_1.setVariableValue("0P_FPER", DROPDOWN_1.getSelectedValue());
Thanks,
Jothi
Hi Jothi,
There could be a number of issues at play:
1) 0FISCPER is compounded with Fiscal Year Variant, which appears to be "K4" for in your case. Make sure "K4" is specified as a default value for the Fiscal Year Variant in the BEx Query definition so that you are not prompted for it each time;
2) There could be a mismatch between the formatting of the Fiscal Year Period (0FISCPER) key value obtained from the getMembers() method compared to the expected format of the 0P_FPER variable. You should check the expected format of the 0P_FPER variable as follows:
(a) Display the value of defaultYear after it has been set in your code
(b) Display the value of DROPDOWN_1.getSelectedValue() and compare the format to the format of defaultYear to ensure they are the same.
Regards,
Mustafa.
Hi Mustafa,
1. FY variant is default set to K4.
2. Yes, that's what it is happening.Mismatch with FYP key values.
a) defaultYear is giving 008/2017 - Prompt 0P_FPER is fine.. Only 0FISCPER is showing Key values as "K42017008"....so on.
Do you suggest to do a substring on the array?. I didn't find that option on Arrays
Thanks,
Jothi
Apologies for the late reply Mustafa,
Yr.forEach(function(Yrlist, index) {
YrMemkey = Convert.subString(Yrlist.internalKey, 2,9);
Yrkeyvalue = Convert.stringToInt(YrMemkey);
Yrmemtext = Yrlist.text; if(Yrkeyvalue <= defaultyr){
//DROPDOWN_1.addItem(Yrlist.internalKey, Yrlist.text);
DROPDOWN_1.addItem(YrMemkey,Yrmemtext); } });
DROPDOWN_1.setSelectedValue(selectedValue);
Dropdown box doesn't display any values
Any input is greatly appreciated.
Thanks,
Jothi
User | Count |
---|---|
95 | |
11 | |
11 | |
6 | |
6 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.