Enable/ Disable concurrent program parameter
Scenario:
Suppose there are 2 parameters in a concurrent program. You want to enable/disable the 2nd parameter based on the first parameter value. For example, you need to disable the parameter Date if the value of the first parameter BANK is SBI. If the value is either 'HDFC' or 'JPM' the second parameter should be enabled.
Steps to achieve this scenario
Step 1: Create Dummy Value Set
Create a value set (we would use this only when in the concurrent program definition)
Step 2: Create value set for first parameter (Bank)
Create an INDEPENDENT value set as below:
Add the list of values to this as u wish:
Navigation Path : Application Developer -> Validation -> Values
Click on Find.
Enter the list of values you wish to appear in the concurrent program parameter list.
Save and close.
Step 3: Create Second Parameter Value Set
Create a value set with Validation Type as 'SPECIAL' as below:
Click on 'Edit Information' and write the below piece of code:
Select 'Validate' from the list box.
Put the below query
FND PLSQL "
DECLARE
BEGIN
IF ':$FLEX$.V_DUMMY'= 1 THEN
RETURN;
END IF;
END;"
Note that in the line of code inside the block: $FLEX$.V_DUMMY, V_DUMMY refers to the value set we initially created in Step 1.
Step 4: Concurrent Program Parameters
Define a concurrent program with 3 parameters as shown below:
In this the p_dummy parameter would not be used in the display but is used as trigger that would get the value from the first parameter and return the value to the second parmeter value set which can enable/disable this.
In the p_dummy value set, the validation type would be as follows: (Uncheck the display check box)
The SQL Statement to be written in here is:
Select 1 from dual where :$FLEX$.V_VALUES IN ('HDFC','JPM')
Note that V_VALUES is the value set we created in Step 2.
The third parameter p_Date would be defined with the V_DATE value set we created in Step 3 as below:
Result:
When we test this concurrent program, the results would be:
The Second Parameter Date is enabled if the first parameter value is 'HDFC' or 'JPM'
Else it is disabled.
Enabled:
Disabled :
This helped me a lot. Thanks for the solution
ReplyDelete