COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: bioCam on 12 Feb 2013 02:39:56 PM

Title: On click Finish button use JS to check enough criteria selected
Post by: bioCam on 12 Feb 2013 02:39:56 PM
If user selects the 'By Location' item in the Location Prompt then there must be at least 1 Country item selected in the Country Prompt. 

I would like to write a JS that would run when the user clicks on the Finish button to check the above rule has been met.  If 'By Location' is selected and there is no Country item selected, I would like to display an alert for the user to take action.

I am using Cognos 10.  Does anyone has JS code I can use?
Title: Re: On click Finish button use JS to check enough criteria selected
Post by: Bark on 13 Feb 2013 04:54:37 AM
Hi,

Have a look at this to know how to check the prompts with JS:
http://www-01.ibm.com/support/docview.wss?uid=swg21376964

Regarding the button Finish, you would need to trick it by creating a button that runs a JS code to check the prompts and with a last statement to invoke the "Finish" functionality.

Example here: http://www-01.ibm.com/support/docview.wss?uid=swg21343513

On the other hand, you coud avoid using Javascript if you create two prompt pages, the second having a mandatory prompt with a display variable and only rendering it if "By Region" is selected in the previous page.

Hope it helps.

Regards,
Title: Re: On click Finish button use JS to check enough criteria selected
Post by: bioCam on 13 Feb 2013 11:00:11 AM
Thank you for replying to my post.  I have done JS a year ago but forgot much of it now so the documents in the link are what i need to help me get started. 
Title: Re: On click Finish button use JS to check enough criteria selected
Post by: bioCam on 13 Feb 2013 11:19:51 AM
Its been quite some time I look into Cognos.  I remembered there was a IBM website I would go to find How to's doc - in the site, I could search for related docs etc.  Is there a specific link I could use without having to navigate through the maze to locate Cognos written how to docs?  thank you.