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
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
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.