Welcome to Communities.
Please do the below steps.
1 - Go to Sysadmin responsibility.
2 - Go to this path Concurrent > Program > Define.
3 - Search for your report.
4 - Press on Parameters tab.
5 - Go to the parameters you want and check the check mark in front of Required field as screenshot below then save.
George that's not the requirement.Which parameter is mandatory is not specified.But while running the program,user cannot keep both parameter value blank.There should be value in atleast one parameter
You said that the request has two parameters, so you can choose any one of them and enable the required flag .
Yes it has two parameters and user can choose to enter value in any one parameter.But we can't force user to enter value in P1 or in P2 or both by enabling Required flag.It is user's choice to choose any one parameter and enter value in it. But it should not be such that there is no value in both the parameters.
Just a thought, create one more hidden parameter, say p3 whose display should be No but required yes.
Once user enter value in either p1 or p2, then enter a dummy value in p3 using valueset.
If there is value in p3, it means either p1 or p2 has value.
If p3 is null system will give error.
Bharat's solution is ideal. The user won't see it, but it will ensure one is populated. Also, you could name the non-displayed parameter "P1 or P2" so that if it doesn't find a default value, then the message will be Parameter P1 or P2 must be specified
Yes your proposal is very logical but I tried below approach and its not working for me.
Default Type:- SQL Statement
Default value of P3 :-SELECT DECODE(:$FLEX$.P1,NOT NULL,'Y',NULL) OR DECODE(:$FLEX$.P2,NOT NULL,'Y',NULL) FROM DUAL
Value Set Type of P3- Special
l_value VARCHAR2 ;
IF :$FLEX$.P1 IS NULL AND :$FLEX$.P2 IS NULL THEN
Could you please help me in this?
I am trying to do so but its not working as expected.I think there is some technical error in my code.Could you please check and help me out.
Change this: Default value of P3 :-SELECT DECODE(:$FLEX$.P1,NOT NULL,'Y',NULL) OR DECODE(:$FLEX$.P2,NOT NULL,'Y',NULL) FROM DUAL
To this: Default value of P3 :-SELECT DECODE(:$FLEX$.P1,NULL , NULL , 'Y' ) || DECODE(:$FLEX$.P2, NULL , NULL , 'Y' ) FROM DUAL
This will return null if both are blank, Y is one is populated, and YY if both are populated.
If this and/or any other comment is useful, please take a moment to it/them and click the Helpful button.
Hi J Reinhart,
Thanks for your response.
I tried but this one is also not working if I keep any one parameter blank.
The Select statement is returning NULL only in this case also as Y||NULL or NULL||Y is NULL .
You are almost there.
SELECT DECODE(:$FLEX$.P1:NULL,NULL , NULL , 'Y' ) || DECODE(:$FLEX$.P2:NULL, NULL , NULL , 'Y' ) FROM DUAL
SELECT (CASE WHEN :$FLEX$.P1:NULL IS NOT NULL OR :$FLEX$.P2:NULL IS NOT NULL THEN 'Y' END) FROM DUAL