SpotOn Systems Blog by the Cognos Integration Experts!

Subscribe by Email

Your email:

Technorati

Your SpotOn the IBM Cognos Edge

Current Articles | RSS Feed RSS Feed

Accessing Prompt Controls in Cognos 8.4 with Javascript

Posted by Darren Nelson on Wed, Apr 15, 2009
 | Submit to Digg digg it | Submit to Reddit reddit | Add to delicious delicious | Submit to StumbleUpon StumbleUpon 

Hi All,

During a recent client engagement, we came across an issue that some of you may have encountered: trying to access prompt controls at runtime.

In the past a Report Studio author could write something like this:

var x = getFormWarpRequest();
var y = x.elements["my control name"];

Of course, this is no longer the case in Cognos 8.4. Instead, the prompt control IDs are system-generated and obfuscated at runtime. In order to access the prompt controls now, you have to first obtain the obfuscated value, and then locate the control.

I've written a piece of code that seems to let me find the prompt control. I hope it helps your efforts!

In brief:

var y = searchPrompts("My prompt name");


Tags: , , , , , , , , , , , , ,

COMMENTS

This is kickass...thanks for the work...saved my day!

posted @ Monday, September 14, 2009 10:27 PM by HKM


Hi 
 
That was a gr8 post. 
 
I used your function like this and it doesn't show me the alert message. 
 
var y =searchPrompts("TEST_TEXT"); 
 
var z=y.value; 
 
alert(z); 
 
 
 
Where am I wrong? 
 

posted @ Friday, January 15, 2010 2:11 PM by Mark


Amazing! thanks a lot. You saved my day too.

posted @ Friday, February 19, 2010 5:36 PM by danman980


Post Comment
Name
 *
Email
 *
Website (optional)
Comment
 *

Allowed tags: <a> link, <b> bold, <i> italics

Receive email when someone replies.