GEMÜ Gebr. Müller Apparatebau GmbH & Co. KG
Original Message:
Sent: Mon August 19, 2024 09:55 AM
From: Scott Hughes
Subject: Prompt Validation
Many thanks Robert, a great solution I will most definitely be implementing!
Cheers
------------------------------
Scott Hughes
Original Message:
Sent: Mon August 19, 2024 07:39 AM
From: Robert Dostal
Subject: Prompt Validation
Hi Scott,
I'm not a fan of Java Script as this needs further knowledge. Use Cognos built-in features instead. You just need a variable that controls the visibility of prompt buttons.
Let's say we have a report with these four optional prompts on the first page:

I created a small table with one column and three rows to place the three prompt buttons Cancel, Reprompt and Finish in each row:

Now I want that the Finish button is only visible when at least one prompt is selected. Go to the variables page and create a new Boolean variable.

The expression must return a true/false result. Therefore I wrote the following statement (drag and drop the parameters if you like):
ParamValue('pReturnReason') is not null
OR
ParamValue('pRegion') is not null
OR
ParamValue('pOrderMethod') is not null
OR
ParamValue('pProductLine') is not null

Then go back to your prompt page and drag a conditional block into the cell where the Finish button is and link this block to the variable (in my case "PromptSelected").

You now get one block for each returned result of the variable. In this case, it's one for Yes and one for No. I placed a simple text in the "No" block and the Finish button in the "Yes" block.

Done.
If there's nothing selected the text appears. If a user selects at least one prompt and hits "Reprompt" the Finish button appears.


------------------------------
Robert Dostal
Team Leader BI
GEMÜ Gebr. Müller Apparatebau GmbH & Co. KG
Ingelfingen
Original Message:
Sent: Mon August 19, 2024 06:22 AM
From: Scott Hughes
Subject: Prompt Validation
Hey all
I have a prompt page with 4 search & select prompts, they are all optional, with no default values. What I want however is that at least one prompt to be used.
Not sure how to achieve this, suspect it will be via a JavaScript button, but don't have the technical knowhow to write one
Can anyone assist me in achieving this?
Cheers
Scott
------------------------------
Scott Hughes
------------------------------