Tuesday 24 February 2015

Validations On Concurrent Program Parameters

Validating the Parameters in Concurrent Programs can be approached by using the Special type LOV.

Scenario:

There are two parameters From Invoice Date and To Invoice Date. The To Invoice Date should not be greater than the 90 days from the From Invoice Date.



Solution:

1. Take the From Invoice Date Parameter with FND_STANDARD_DATE Value Set.
2. Create a Special Type Value Set "XX_DATE_SPECIAL" with Action Validate.


3. Add the Below code to the code-section

FND PLSQL "DECLARE
l_frm_dte DATE:=to_date(':$FLEX$.P_FROM_INV_DATE','YYYY/MM/DD HH24:MI:SS');
l_to_dte DATE:= :!VALUE;
BEGIN
IF l_to_dte > l_frm_dte + 90 THEN
FND_MESSAGE.SET_NAME('FND','FND_GENERIC_MESSAGE');
FND_MESSAGE.SET_TOKEN('MESSAGE','Please enter date range less than 90 days.');
FND_MESSAGE.RAISE_ERROR;
END IF;
END;"

4. Create a Parameter To Invoice Date and attach the Special Value set "XX_VALIDATE_DATE90"


1 comment: