Customized-prompt page based on DB values

Hi,

I need to create a customized-prompt page, based on variables (render+style) that derived from configuration tables in my DB.

I am trying to do it with “hidden” prompt page, that uses javascript to select some values from the DB, and then automatically redirects to the prompt page itself.

For the automatic redirection I’m using “promptButtonNext();”. However, when I’m re-running the report (after getting the results) instead of showing again the prompt-page, it skips it, and brings me back to the report page.

If I’m removing “promptButtonNext();” from the script, and uses a mannual “Next” button on the hidden prompt page, it works, and I’m getting to the prompt-page as expected

What am I doing wrong ? Is there a better way implemeing what I’m trying to achieve?

Thanks,
Or

p.s. - This scripts works OK in cognos 8.2… But I’m getting this error in cognos 10.2

The solution for swithcing to the next page is as follows :