If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

Javascript for Creating Finish Button

Started by Kiran Kandavalli, 09 Jun 2016 10:11:37 PM

Previous topic - Next topic

Kiran Kandavalli

Team.

I am using Javascript code for creating Finish button.

1) when Mandatory prompts were not selected it is throwing me the below error message, and it is Navigating to default page which is generated by cognos and asking me the mandatory filters there...like when we do View Tabular data for selecting prompts when we do not create prompt page.

error message:

"One or more of the required values is missing. Required values are needed to produce the report".

Code used to create JavaScript button

<input type="BUTTON" class="clsPromptButton" onClick="test()" value="Finish"/>


I have used CanSubmitPrompt() in test function --> but it is not working. I am using Cognos 10.2.1 version.

if(canSubmitPrompt();)
   {
   promptButtonFinish();
   }

Can someone suggest me on this. The control need to be in Prompt page only.

Thanks!
Kiran






HalfBloodPrince

If you can share the Java script then it will be easier to understand what you want to do

BigChris


Kiran Kandavalli

#3
Team,

Here is the code. The Code is in Orange is checking only for Tree Prompt, I want to make only that condition applicable for all Mandatory Prompts.

1) This Function I need to call using a Finish Button, This Function also need to check all Mandatory Prompts are selected or not then only Finish Button need to be enabled.

function test()
{
                 var tree =  window.treeT;
                 var selectedNodes = getSelected(tree.getRootNode());
                 var fist_val=selectedNodes[0];
                 var len=selectedNodes.length;

                 var bl=1;
                 for (i=1;i<len;i++)
                                 {
                                 if(selectedNodes==fist_val)
                                 {
                                 bl=1;
                                 }
                                 else
                                 {
                                 bl=0;

                                 alert("You Can Not Select Two Different Levels");
                                 break;
                                 
                             

}
if(bl==0)
{
break;
}

                                 }
if(bl=1)
{
promptButtonFinish();
}

                 
}


Thanks!
Kiran

HalfBloodPrince

#4
I am not sure what prompts you have on page and how it will be checked. I am just giving general syntax to validate and submit a prompt using java script.
Add there html items.
in first item add code
<input type="BUTTON" class="PromptButton" onClick="test()"value="Submit"> will call your java script function.
second HTML will have java script function code

script type="text/javascript">
function test ()
{

        if (ur code to check any values selected or not etc)
        {
            alert("Select missing prompt msg etc "); 
        }
else
{
promptButtonFinish();
}
}
</script>

third HTML add </span>

You can check out Cognos prompt using java script to extract and test values of other prompts .
http://www-01.ibm.com/support/docview.wss?uid=swg21376964