on 09-15-2014 4:49 PM
Hello Fellow Coders,
I am using BOBJ Design Studio version 1.3 and am facing a very weird error when executing my application. I have three cascading drop down filters in my application for STATE, CITY and LOCATION. Based on my state selection, only relevant Cities belonging to that state is populated in the drop down. Same is the case with LOCATION drop down which gets populated based on CITY selection.
The issue that I am facing is when I don't select anything for CITY, system sends ALL_MEMBERS as the filter criteria. Eventhough my end result is correct, I get this error message Input "(ALL_MEMBERS)" for Ship To City Code has an invalid format. In my code, I am sending blank for the filter values but it is still giving issue. Has anyone ever came across this issue and would like to share it with me? I do really appreciate y'all's input.
Please see the attached screenshot
Raj,
Is "All member" or "All" defined at database level or in front end? If it is at database level, you hardcode the values for state, city and location (refer screen shot) and pass the key value where ever it is required. i.e.
DS_1.setfilter("State", Dropdown1.getselectedvalue());
DS_1.setfilter( "City", Dropdown2.getselectedvalue());
DS_1.setfilter( "Location", Dropdown3.getselectedvalue());
So, when ever you select "All city" it will automatically pass blank value and fetch the list of location values to dropdown3 (you can ignore "All location" if it comes from database and hardcord it like in above pic)
This is how my dashboard works
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Raj,
You do not have to write the if condition at all,
As you are mentioning All in the script to load the combo box, the value for that All will be blank.
So technically you do not need that if loop statement.
Can you try it without the Loop and see if it is working?
Regards,
Fazith Ali Z.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Fazith,
Thank you for your response and sorry for my delayed response. You are right that there is no need to put If statement which i realized after posting this question on the forum. So i took the statement out but i was till getting the same error.
Since my output was coming out correctly, I just selected the setting under Properties tab-->Display --> Displayed Message Types --> None. I know this is a work around but considering that I was running against time, i just did that and things are working fine now.
Changing this setting does not solves issue of error message prompt, it only hides it from display.
Hi Raj,
Can you check this post and see if it would solve this for you? Or if it already did, since it passed so long time. And if so, please mark this question as answered.
Bogdan Popescu Jan 11, 2016 4:13 PM
Hi Lex,
I can agree that the SetVariableValue function is the one that was causing the above errors. But another "workaround" would be to send the data in the right format through the function.
In order to find out what is the right format I would suggest, you send a value to the variable (prompt) via the Prompt Dialog. And then use a script to retrieve the value to a text (retrieving the value of the promp will be made upon datasources ex: DS_1.getVariableValue). Then you know what is the format so you can code it in the script where you put setVariableValue function.
Regards,
Bogdan
Regards,
Bogdan
can you share the code which is sending it? I think you need to place an if condition there if the selected key is ALL_MEMBEERS, then the selection is empty.
like this:
var selectionKey = DROPDOWN_1.getSelectedValue();
var realSelection = selectionKey;
if(selectionKey == "ALL_MEMBERS") {
realSelection = "";
}
DS_1.setFilter...(<DIM>, realSelection");
check up if this helps
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Raj,
Showing your original script will help us to get clarified with this issue ,
to be generic When you select your STATE dropdown, the corresponding cities gets populated
in the CITY dropdown, when you select CITY, the corresponding LOCATION.
The problem arises when you skip the CITY dropdown selection , but you have populated the location with the city selection .
One thing which may help is call CITY dropdown Onselect event at the event of STATE dropdown selection so that it selects the default value.
If you have already done all this, Kindly ignore and try to post the exact script which you have used.
Thanks
karthik Swaminathan
please check your key in drop down for all members, are you setting it like this:
DROPDOWN_1.setItems(DS_1.getMemberList("0BC_PERS1", MemberPresentation.INTERNAL_KEY, MemberDisplay.TEXT, 100, "ALL"));
?
and in the script, you just need:
var dropValue = DROPDOWN_1.getSelectedValue();
if(dropValue == "ALL") {
DS_1.clearFilter("0BC_PERS1");
} else {
DS_1.setFilter("0BC_PERS1", dropValue);
}
Hi all,
This message is invoked by the APPLICATION.SetVariableExt() method, not the setfilter methods.
I am using the SetVariableExt() method in order to have a kind of cascading dropdown with 4 dimensions, where every dimension influences the other 3.
Selecting the ALL_MEMBERS value invokes this message. I use this syntax:
APPLICATION.SetVariableExt(<Parameter>, "")
I have not found any other solution then the workaround mentioned in this thread (setting the messages level to none).
Regards,
Lex.
Hi Lex,
I can agree that the SetVariableValue function is the one that was causing the above errors. But another "workaround" would be to send the data in the right format through the function.
In order to find out what is the right format I would suggest, you send a value to the variable (prompt) via the Prompt Dialog. And then use a script to retrieve the value to a text (retrieving the value of the promp will be made upon datasources ex: DS_1.getVariableValue). Then you know what is the format so you can code it in the script where you put setVariableValue function.
Regards,
Bogdan
Hi Bogdan,
Thanks for your reply. You put me on the right track. This is what I found.
After selecting the "All Products" value in the dropdown list .getSelectedValue() results in "(ALL_MEMBERS)".
I was using the following script, which invoked the error message:
var sProduct = DROPDOWN_PRODUCT.getSelectedValue();
if (sProduct == "ALL Products" )
{
sProduct = ""
}
APPLICATION.setVariableValueExt("psProduct", sProduct);
The All Members Text is NOT what is returned after selecting it from the Dropdown List.
So then I tried (and it still didn't work):
var sProduct = DROPDOWN_PRODUCT.getSelectedValue();
if (sProduct == "(ALL_MEMBERS)")
{
sProduct = ""
}
APPLICATION.setVariableValueExt("psProduct", sProduct);
Now I use this script, which works fine.
var sProduct = DROPDOWN_PRODUCT.getSelectedValue();
if (sProduct == "(ALL_MEMBERS)" )
{
APPLICATION.setVariableValueExt("psProduct", "");
}
else
{
APPLICATION.setVariableValueExt("psProduct", sProduct);
}
User | Count |
---|---|
87 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
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.