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

Set and Select Value Prompts default value Dynamically

Started by kado, 20 Jun 2012 11:05:15 PM

Previous topic - Next topic

kado

Hello Cognoise -

Has anyone ever used some Java to default a value prompt dynamically based on a value from a query? Or in other words ... Is there anyway to set and select a value prompt without placing a value in the 'Default' property of the Value Prompt (since you can only hard-code a value here)?

THANKS!

kado

I found a potential solution out on the ITtoolbox for Cognos 8 but I can't get it to work with Cognos 10 ... nothing happens. Anybody with some Java skills help me out?

THANKS



Try these (If the type of prompt) is drop down:

1) Sort the dates such that they appear in descending order.
2) In the properties of the value prompt, under Miscellaneous section, specify a value for the name property.(Here it is 'Prompt')
3)Drag and drop an HTML object from Toolbox tab to the prompt page after the value prompt.
4) Put in the following javascript so that the first date appears as a default date in the prompt:

<script language="javascript">
var f = getFormWarpRequest();
var list = f._oLstChoicesPrompt;

list.remove(1);
list.remove(0);
list.removeAttribute("hasLabel");
list.options[0].selected = true;

canSubmitPrompt();
</script>