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

Prompt API (onload event)

Started by darners, 03 Sep 2015 08:22:01 AM

Previous topic - Next topic

darners

HI, I am trying to get a prompt api to run when the prompt page is loaded

<script>
function clearValues() {
var oCR = cognos.Report.getReport("_THIS_");
var promptFini = oCR.prompt.getControlByName("fini");
        var selection1 = [{'use': 'Y'}];
        promptFini.setValues(selection1);
}
</script>

This works fine if I make it a button or a link but I need it to run whenever the prompt page loads

I have tried placing the html in various places on the prompt page but without success

Any ideas?

Cheers

darners

any ideas gratefully received :)



Quote from: darners on 03 Sep 2015 08:22:01 AM
HI, I am trying to get a prompt api to run when the prompt page is loaded

<script>
function clearValues() {
var oCR = cognos.Report.getReport("_THIS_");
var promptFini = oCR.prompt.getControlByName("fini");
        var selection1 = [{'use': 'Y'}];
        promptFini.setValues(selection1);
}
</script>

This works fine if I make it a button or a link but I need it to run whenever the prompt page loads

I have tried placing the html in various places on the prompt page but without success

Any ideas?

Cheers

mrcool

I am not good in JS or HTML but I think you shoud use onload event inorder to execute the script while loading the page.