COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: vsr on 06 Aug 2009 06:18:52 PM

Title: Saving Prompt value while scheduling in 8.3
Post by: vsr on 06 Aug 2009 06:18:52 PM
Hi All,

Saving prompt values while scheduling does not work with our reports because of custom Finish button and Java script used to validate the prompt values.

Attached the script here.Please help me how to make this work.

<input type="BUTTON" onClick="checkPromptValues();" value="Finish"> 
<script>
function getComboCnt(comboBox){
   //get count of selections in combo box prompts
   var cnt=0;
   for(i=0;i<comboBox.length;i++){
      if(comboBox.options.selected){
         cnt++;
      }
   }
   return cnt;
}
function checkPromptValues(){
   var frm = getFormWarpRequest();
   var comboPN=frm._oLstChoicesPN;   //Protocol Prompt   
   cntPN=getComboCnt(comboPN);   //Counting values in Prompt
   if(cntPN<=1000){
         promptButtonFinish();
   }
   else {
      comboPN.selectedIndex=0;   //Pointing to first value
      promptButtonFinish();
   }
}   
</script>