Hi All,
I have a Single Select Search and Select(SnS) prompt, where Search by Wildcard '%' should not be allowed.
Basically Search by % would show all the values and that could result in performance issues.we have around 200K values for the prompt.
I was thinking if a Javascript needs to be created that will validate the SnS prompt and when the user searches by % it will show a message
"Search All using wildcard characters is disabled please search for specific values"
Any Help is much appreciated.
Thanks.
I have had some sucess with this. I am able to get the value of the Entered text and check if its % or not, But only one thing is pending. i.e even after the message "", Search Result box is displayed with the values in the prompt. I don't want to search for values when % is entered.
if(SelectedRadio == 'ACCOUNT_CUSTOMER')
prompt = 'ACprompt';
else if (SelectedRadio == 'BILLING') prompt = 'Aprompt'; else prompt = 'Pprompt';
Var EnteredValue=ValidateSnSKeyword(prompt);
if(EnteredValue=='%')
{
alert('Search All using wildcard characters(%) is disabled please search for specific values');
}
function ValidateSnSKeyword(SpanID){
var mySpan = document.getElementById(SpanID);
var myInput = mySpan.getElementsByTagName("input");
return myInput[1].value;
}
Finally Solved..below is the code.
if(EnteredValue=='%')
{
alert('Search All using wildcard characters(%) is disabled please search for specific values');
clearSearchValues();
}
//Update the values for i based on which prompt you want to clear
function clearSearchValues() {
var oCR = cognos.Report.getReport("_THIS_");
var aControls = oCR.prompt.getControls();
for (var i = 4; i < aControls.length; i++) {
aControls.clearValues();
}
}